Skip to content

Instantly share code, notes, and snippets.

View JFKingsley's full-sized avatar

Jonathan JFKingsley

View GitHub Profile
if (cluster.isMaster)
cluster.fork() for i in [0...numCPUs]
else
@server = http.createServer(@onRequest)
@io = socketio.listen(@server, collectedOptions)
@io.sockets.on 'connection', @onConnection
@server.listen @port, cb
// Load `*.js` under current directory as properties
// i.e., `User.js` will become `exports['User']` or `exports.User`
require('fs').readdirSync(__dirname + '/').forEach(function(file) {
if (file.match(/.+\.js/g) !== null && file !== 'index.js') {
var name = file.replace('.js', '');
exports[name] = require('./' + file);
}
});
@brendanashworth
brendanashworth / gist:3ff908eaf695f834fb60
Last active March 26, 2016 05:24
Every single *File that exists in these different language/libraries...
Podfile
Capfile
Gemfile
Gomfile
Makefile
Thorfile
Cakefile
Caskfile
Jakefile
Doxyfile
@orangkucing
orangkucing / MewProSpec.md
Last active June 14, 2016 20:20
Compare MewPro Specs
MewPro 1 MewPro 2 MewPro Cable
Image 1 2 Cable
Release date 11 Oct 2014 20 Jun 2015 20 Jun 2015
Processor (not built-in *1) ATtiny1634 8MHz ATtiny1634 8MHz
I2C EEPROM Microchip 24AA01 (emulated) (emulated)
Connector Ridax JAE DD1B030VA1 JAE DD1P030MA1
FTDI header Yes Yes No
Universal area Yes *2 No No
Genlock Yes *3 Yes Yes
@imkevinxu
imkevinxu / vidtogif.sh
Last active June 17, 2016 17:35
Convert an animated video to gif from http://chrismessina.me/b/13913393/mov-to-gif
# Convert an animated video to gif
# Works best for videos with low color palettes like Dribbble shots
#
# @param $1 - video file name like `animation.mov`
# @param @optional $2 - resize parameter as widthxheight like `400x300`
#
# Example: vidtogif animation.mov 400x300
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew
#
# http://chrismessina.me/b/13913393/mov-to-gif
@daraosn
daraosn / drone_swarm.sh
Last active April 15, 2017 02:03
Hack to connect multiple Parrot AR Drone 2.0 and create a swarm
## Hack to connect multiple Parrot AR Drones.
#############################################
## Instructions:
## 1. Connect to your AR Drone wifi network.
## 2. Open your terminal and do 'telnet 192.168.1.1'
## 3. Copy the script and replace DRONE_ID with the desired ID number (between 3-255).
## 4. Paste and run the script for every drone on the swarm.
DRONE_ID=200
sed -i "s/PROBE=1/PROBE=${DRONE_ID}/" /bin/wifi_setup.sh
@bellbind
bellbind / dh-usage.js
Created October 21, 2011 07:09
[nodejs][javascript] Diffie-Hellman key exchange by nodejs-0.5
// node.js 0.5 Diffie-Hellman example
var assert = require("assert");
var crypto = require("crypto");
// the prime is shared by everyone
var server = crypto.createDiffieHellman(512);
var prime = server.getPrime();
// sharing secret key on a pair
@border
border / Makefile
Created January 12, 2011 01:36
json example in golang
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go
@trevordixon
trevordixon / renderElement.js
Created July 25, 2012 14:37
Function to render only a particular element in PhantomJS
function renderElement(page, selector) {
var prevClipRect = page.clipRect;
page.clipRect = page.evaluate(function(selector) {
return document.querySelector(selector).getBoundingClientRect();
}, selector);
var pic = page.renderBase64('png');
page.clipRect = prevClipRect;
@0xabad1dea
0xabad1dea / severscam.md
Last active July 12, 2021 01:32
Sever Scam

The Scammiest Scam To Yet Anonymity Scam

I'm still holding out for this being a hoax, a big joke, and that they're going to cancel the kickstarter any minute. It'd be quite the cute "lessons learned" about anonymity scams. However, I will be treating it from here on out as a genuine scam. (As of May 2nd, the kickstarter has been cancelled, after the strangest attempt to reply to this imaginable. Good riddance.)

This absolutely ridiculous thing was brought to my attention by a friend and since it was late at night I thought I must be delirious in how absurdly over the top fake it seemed. So I slept on it, woke up, and found that it had gotten a thousand dollars more funding and was every bit as flabbergasting as I thought it was.

Since I realize that not everyone has spent their entire lives studying computers – and such people are the targets of such scams –