This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.flex { | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
} | |
.flex.flex--reverse { | |
-webkit-box-orient: horizontal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import * as d3 from 'd3' | |
export default class CircularProgress extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
aProgress: props.min | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://imququ.com/post/web-proxy.html | |
// test cmd: | |
// curl --proxytunnel -x http://localhost:8000 --proxy-basic --proxy-user a:b httpbin.org/get | |
var http = require('http') | |
var net = require('net') | |
var url = require('url') | |
function connect(cReq, cSock) { | |
let u = url.parse('http://' + cReq.url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx -p typescript -p ts-node -c "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec 'ts-node' src/server/app.ts" | |
debug: | |
npm i ts-node --no-save | |
npx -p typescript -p ts-node -c 'node -r ts-node/register --inspect-brk src/server/app.ts' | |
npx webpack --progress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from '@emotion/styled' | |
import _ from 'lodash' | |
const DirectDict = { | |
t: [0], | |
r: [1], | |
b: [2], | |
l: [3], | |
x: [1, 3], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://unix.stackexchange.com/questions/10428/simple-way-to-create-a-tunnel-from-one-local-port-to-another | |
ssh -L -R # limit for 0.0.0.0 | |
watch -n0 busybox nc -l -p 3389 -e /bin/nc 127.0.0.1 8000 # have restart time gap | |
socat tcp-listen:443,reuseaddr,fork tcp:localhost:8080 # need install | |
# can not install socat, compile yourself? https://github.com/cornerpirate/socat-shell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in: [['xxx'], ['yyy', 'zzz'], ...] | |
// out: [['xxx', 'yyy', ...], ['xxx', 'zzz', ...]] | |
function calcCombination(options) { | |
if (_.isEmpty(options)) { | |
return [[]] | |
} | |
let [firstOpt, ...rest] = options | |
let remainCombinations = calcCombination(rest) | |
return _.flatMap(remainCombinations, rc => { | |
return firstOpt.map(o1 => [o1, ...rc]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html style="font-size: 100px"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Cache-control" content="no-cache"> | |
<meta http-equiv="Expires" content="-1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> | |
<% if (context.title != null) { %> | |
<title><%= context.title %></title> | |
<% } %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
purge: ['./src/**/*.html', './src/**/*.tsx', './src/**/*.ts'], | |
darkMode: false, // or 'media' or 'class' | |
theme: { | |
// https://github.com/tailwindlabs/tailwindcss/issues/1232 | |
// using px2rem, 1rem = 100px for 1920 screen | |
fontSize: { | |
"xs": "0.12rem", | |
"sm": "0.14rem", | |
"base": "0.16rem", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as d3Scale from "d3-scale" | |
import _ from "lodash"; | |
export interface MappingInfo { | |
onWindowSize: number[] | |
screenA: number[] | |
geoA: number[] | |
screenB: number[] | |
geoB: number[] | |
} |