Skip to content

Instantly share code, notes, and snippets.

View leeight's full-sized avatar
💭
I may be slow to respond.

Li YuBei leeight

💭
I may be slow to respond.
View GitHub Profile
@ssddi456
ssddi456 / random_direction.html
Last active August 29, 2015 14:14
random text genaration
<meta charset="UTF-8">
<textarea name="" id="in" cols="30" rows="10">
here is some random direct text!
happy chart;
这是一段随机文字
</textarea>
<div>
<label>chaos_lv</label>
<input type="radio" value="1" name="chaos_lv" checked> 1
<input type="radio" value="1.5" name="chaos_lv"> 1.5
@leeight
leeight / boot.js
Created June 7, 2014 13:32 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@jdx
jdx / boot.js
Last active March 16, 2023 18:08
zero-downtime node.js app runner
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@leemars
leemars / README.markdown
Last active February 27, 2024 14:26
jumbo

jumbo

A package management system which allows installation to non-system location.

点此 为 jumbo 捐款!

jumbo 是什么?

jumbo 是一个适用于百度测试机环境的包管理工具, 使用它可以方便地管理各种软件包. 真的, 不会再有比这个更方便的管理工具了!

@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@eligrey
eligrey / gist:1079572
Created July 13, 2011 01:47
BlobBuilder.js