Skip to content

Instantly share code, notes, and snippets.

View yiskang's full-sized avatar

Eason Kang yiskang

View GitHub Profile
@burnto
burnto / gist:943432
Created April 26, 2011 23:50
.bash_profile colors
export TERM=xterm-color
# set colors and prompt
#PS1="\[\e]2;\w\a\][\[\e[32m\]\u\[\e[0m\]@\[\e[31m\]\h\[\e[0m]\]:\[\e[35m\]\w\[\e[0m\]$ "
#PS2=">> "
#export PS1 PS2
export CLICOLOR="true"
export LSCOLORS="exfxcxdxbxegedabagacad"
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
@ecarter
ecarter / mapOrder.js
Created December 2, 2011 15:40
Order an array of objects based on another array order
/**
* Sort array of objects based on another array
*/
function mapOrder (array, order, key) {
array.sort( function (a, b) {
var A = a[key], B = b[key];
@caged
caged / d3-multi-line.js.coffee
Created December 30, 2011 17:23
d3.js line chart with multiple lines and points
$ ->
version = Number(document.location.hash.replace('#', ''))
data = [[3,7,9,1,4,6,8,2,5], [5,2,3,4,9,6,4,6,8]]
[pt, pl, pr, pb] = [20, 20, 20, 20] # padding
w = 800 - (pl + pr)
h = 300 - (pt + pb)
max = d3.max(data, (d) -> d3.max(d))
# Scales
x = d3.scale.linear().domain([0, data[0].length - 1]).range [0, w]
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active September 12, 2024 07:05
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@hugooliveirad
hugooliveirad / rsync-from-ftp.sh
Last active June 21, 2018 14:11
Rsync from FTP server
# Mounts FTP server
open -a Finder ftp://login:password@ftp_host/path
# Rsync from there (add --dry-run option to simulate transfer)
rsync -arvz --no-o --no-g /Volumes/ftp_host/path/ ./
# WIN!
@ghostwords
ghostwords / .eslintrc
Last active February 13, 2024 07:35 — forked from cletusw/.eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"arrowFunctions": false, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"classes": false, // enable classes
"defaultParams": false, // enable default function parameters
"destructuring": false, // enable destructuring
this.colliders = [];
var loader = new THREE.ObjectLoader();
loader.load('models/school/scene.json', function (obj) {
me.scene.add(obj);
player = new THREE.Object3D();
player.add(me.camera);
me.scene.add( player );
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active November 3, 2024 21:30
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@forabi
forabi / Webpack 2.0.7-beta vs Rollup
Last active August 20, 2024 13:14
Webpack 2 vs Rollup
❯ rollup --version
rollup version 0.25.3
❯ time rollup -c ./rollup.js
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total
❯ time webpack
Hash: ebb00bbccd954c114d3c
Version: webpack 2.0.7-beta
Time: 3623ms