Skip to content

Instantly share code, notes, and snippets.

View gucheen's full-sized avatar

Cheng Gu gucheen

View GitHub Profile
@gucheen
gucheen / doc.css
Last active May 28, 2019 01:37
css for documentation
body,html{
margin:0
}
body{
padding:2em
}
a{
word-break:break-all
}
pre{
@gucheen
gucheen / generateQueryParams.js
Last active May 17, 2019 07:10
generate query params from object like URLSearchParams()
const generateQueryParams = (obj) => {
if (typeof obj !== 'object') {
return '';
}
const strs = [];
Object.keys(obj).forEach((key) => {
const k = encodeURIComponent(key);
const item = obj[key];
if (Array.isArray(item)) {
item.forEach((i) => {

软件

ack
aria2
asciinema
bat
ctags
curl
diff-so-fancy
fd
const request = require('request');
const util = require('util');
const fs = require('fs');
const path = require('path');
const os = require('os');
const get = util.promisify(request.get);
const post = util.promisify(request.post);
const sleep = (ms) => {
@gucheen
gucheen / index.html
Created August 9, 2018 09:44
Radio Toggle Switch
<fieldset class="radio-switch">
<legend>
Settings
</legend>
<input type="radio" name="lol" id="public">
<label for="public">
On
</label>
<input type="radio" name="lol" id="private">
@gucheen
gucheen / color-scheme-wsl.reg
Created May 19, 2018 14:04
color scheme for wsl
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
; 00BBGGRR, not RGB!
"ColorTable00"=dword:00000000 ; 0 - black
"ColorTable04"=dword:000000CD ; 1 - dark red
"ColorTable02"=dword:0000CD00 ; 2 - dark green
"ColorTable06"=dword:0000CDCD ; 3 - dark yellow
"ColorTable01"=dword:00EE0000 ; 4 - dark blue
"ColorTable05"=dword:00CD00CD ; 5 - dark magenta
$main-font: "Roboto","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
$code-font: "Droid Sans Mono", monospace;
/* PRETTY PRINTING STYLES for prettify.js. */
.prettyprint {
position: relative;
}
/* Specify class=linenums on a pre to get line numbering */
@gucheen
gucheen / 读书记录.md
Last active February 16, 2019 03:06
读书记录
  • 柔软的宇宙
  • 时间的形状
  • 太空全书
  • 星空的琴弦
@gucheen
gucheen / eslint-pre-commit.sh
Created September 1, 2017 09:09
eslint-pre-commit
#!/bin/sh
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".js\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@gucheen
gucheen / index.html
Created August 25, 2017 05:41
Personal Website Landing page
<div class="cover">
<div class="bg"></div>
<div class="title">
<div class="logo">
</div>
<div class="text">
This is the title
</div>
<div class="desc">