Skip to content

Instantly share code, notes, and snippets.

View gist:d0802f7a919ae86ff25e
#!/usr/bin/env node
"use strict";
console.log("This is pid " + process.pid);
setTimeout(function () {
process.on("exit", function () {
require("child_process").spawn(process.argv.shift(), process.argv, {
cwd: process.cwd(),
@silverwind
silverwind / readdirbench.js
Created Aug 5, 2018
recursive fs.readdir benchmark
View readdirbench.js
"use strict";
const fs = require("fs");
const util = require("util");
const p = process.argv[2];
function time() {
const t = process.hrtime();
return Math.round((t[0] * 1e9 + t[1]) / 1e6);
}
@silverwind
silverwind / nginx.conf
Last active Sep 1, 2017
Nginx TLS proxy for droppy
View nginx.conf
user http;
worker_processes 1;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
View ococat.css
body { background: #222 }
#octo #cat { fill: #fff }
#octo { position: fixed; height: 100%; width: 100% }
#octo .part {
animation-name: fade;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
fill: #333;
@silverwind
silverwind / gist:7647456
Last active Dec 29, 2015
109 unique, light and distinguishable colors.
View gist:7647456
#9576ff
#869a00
#c67f66
#ff0095
#809b31
#92bc82
#919191
#ff4593
#f79c0d
#d2ad00
View gist:6741581
install: /usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/
programs: =/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/bin/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/bin/
libraries: =/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/lib/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/lib/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../:/lib/armv6l-unknown-linu
View gist:6741509
install: /usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/
programs: =/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/local/lib/cw/../lib/gcc/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/bin/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/bin/
libraries: =/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/local/lib/cw/../lib/gcc/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/lib/armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../armv6l-unknown-linux-gnueabihf/lib/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../armv6l-unknown-linux-gnueabihf/4.7.2/:/usr/local/lib/cw/../lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../:/lib/armv6l-
@silverwind
silverwind / spacing.css
Created Aug 5, 2013
hack fix for line number spacing
View spacing.css
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("^http(s)?://((www|gist|help|status).)?github.*") {
/* Github Dark Theme v1.3.5 (6/18/2013)
* https://github.com/Mottie/Github-Dark
* http://userstyles.org/styles/37035
* License: http://sam.zoy.org/wtfpl/
*/
View devtools.css
@-moz-document url("chrome://browser/content/devtools/markup-view.xhtml") {
body { font-size: 15px !important; font-family: monospace !important; background: linear-gradient(#282828, #111) !important; background-attachment: fixed !important; }
.editable, .codebox { color: #ccc !important; }
.tagname { color: #f5a !important; }
.attrname { color: #5af !important; }
.attrvalue { color: #fa5 !important; }
.editable:focus { outline: none !important;}
.attreditor:hover { border-bottom: 1px dotted #ccc !important; }
.theme-selected { background: transparent !important;}
.theme-selected:after { content: ''; position: absolute; top: 0; left: -4000px; width: 8000px; height: 100%; z-index: -1; border: 1px solid #555; background: linear-gradient(#000,#111); }
@silverwind
silverwind / setClass.css
Last active Dec 17, 2015
Set a class once the DOM has fully loaded it
View setClass.css
@keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); }
}