Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
@nmn
nmn / pureFunctions.js
Last active August 29, 2015 14:26
Quick and dirty hack to make pure functions work in React:
function component(fn){
class C extends React.Component {
render(){
return fn(this.props, this.context)
}
}
C.displayName = fn.displayName || fn.name
C.propTypes = fn.propTypes
C.contextTypes = fn.contextTypes
return C
@joseluisq
joseluisq / .eslintrc
Last active June 22, 2016 07:10 — forked from ghostwords/.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
@johnnyji
johnnyji / partytime.js
Created July 25, 2015 21:56
It's Party Time
var sys = require("sys");
var exec = require('child_process').exec;
var five = require('johnny-five');
var board = new five.Board();
function puts(err, stdout, stderr) { sys.puts(stdout) };
board.on('ready', function() {
console.log("board ready");
var button = new five.Button(5);
@gyaresu
gyaresu / bots
Created July 25, 2015 20:25
bot servo test
var five = require('johnny-five')
var board = new five.Board()
board.on('ready', function () {
var servo = new five.Servo(9)
board.repl.inject({
servo: servo
})
@27Bslash6
27Bslash6 / phantom-docker-daemon.sh
Last active August 29, 2015 14:23
How does the docker daemon respond if it's not running?
# Ubuntu 14.10
uname -a
## Linux box 3.16.0-41-lowlatency #55-Ubuntu SMP PREEMPT Sun Jun 14 18:59:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/issue
## Ubuntu 14.10 \n \l
# Latest Docker development version
docker -v
## Docker version 1.7.0-dev, build 6a7a757
@gyaresu
gyaresu / gist:8ec65881ef162bf879ec
Created May 23, 2015 22:23
How to catch a stream error (using through2)
var tr = require('through2')
function write(buffer, encoding, next) {
try {
this.push(buffer.toUpperCase()) //buffer needs .toString()
} catch (e) {
this.emit('error', e)
}
next()
}
@gyaresu
gyaresu / gist:1848acc320e4c441d995
Last active August 29, 2015 14:21
Nodeschool Vancouver 2015-07-25

Dear NodeSchoolers,

Hi!

I'm { Gareth: https://twitter.com/gyaresu }

I'll be one of the mentors helping out on International NodeBots day and I must say, I'm REALLY EXCITED!

Teaching is the best way to learn, and I love hanging out with people who are brave enough to learn new things. So thanks!

{
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
},
// I want to use babel-eslint for parsing!
"parser": "babel-eslint",
"env": {
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active May 16, 2025 20:51
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016