I love crafting new stuff and make things happen.
My interested fields includes:
- Web / GUI / Graphics
- ML / DL
# poc of string interpolation in bash / github action | |
- name: print env variables to job output | |
run: for v in `cat env` ; do echo "::set-env name=${v%%=*}::${v##*=}" ; done | |
- name: use (maybe ) in shell command | |
run: docker push myrepo/myapp:${TAG_REF#refs/tags/} | |
env: | |
TAG_REF: ${{ github.ref }} |
module Converter | |
class BaseConverter | |
def initialize input_file, **options | |
@input_file = input_file | |
@options = options | |
end | |
def write output_file, force: false | |
if output_file.exist? && !force | |
puts " NOT overwriting #{output_file}. remove dest file and rerun or specify 'force' flag" |
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |
// TYPE_ROOT/next-mui-helper/index.d.ts | |
declare module 'next-mui-helper/nextjs/makeNextDocument' { | |
import { Theme } from "@material-ui/core"; | |
const makeNextDocument: (muiTheme?: Theme) => React.Component; | |
export = makeNextDocument; | |
} |
{ | |
// silly way to prevent next.js clearing screen | |
// see https://github.com/zeit/next.js/blob/41eaa9cf5ade8f233439a80f7e846ccb00ef3f18/packages/next/build/output/store.ts#L24-L25 | |
const readline = require('readline'); | |
readline.cursorTo = readline.clearScreenDown = () => {}; | |
} |
{ | |
// silly way to prevent next.js clearing screen | |
// see https://github.com/zeit/next.js/blob/41eaa9cf5ade8f233439a80f7e846ccb00ef3f18/packages/next/build/output/store.ts#L24-L25 | |
const readline = require('readline'); | |
readline.cursorTo = readline.clearScreenDown = () => {}; | |
} |
happens on first navigation
p1 = await App.getInitialProps
Page.getInitialProps
in turnconst html = ReactDOM.hydrate(<App { ...p1 }>);
res.send(html, p2 = JSON.stringify(p1)
ReactDOM.render()