Skip to content

Instantly share code, notes, and snippets.

@brian-lc
brian-lc / net_led.erl
Last active April 7, 2016 07:21
Remote LED with erlang
-module(net_led).
-export([start_light/0, switch/2, light/1, decouple/1]).
decouple(Light_Node) ->
{light, Light_Node} ! decouple,
io:format("Switch is decoupled~n", []).
switch(Light_Node, Action) ->
{light, Light_Node} ! {switch, self(), Action},
{
"directory": "components"
}
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@nefD
nefD / gist:4947215
Created February 13, 2013 19:10
My personal vimrc
syntax on
set mouse=a
set ai
set ts=4
set nowrap
set sidescroll=10
set ignorecase
set tabstop=4
set shiftwidth=4
set foldcolumn=3
@brendandixon
brendandixon / twitter-bootstrap-btn-flat
Created January 27, 2013 20:20
Flat button styles for Twitter Bootstrap - conveniently borrowed from https://github.com/twitter/bootstrap/issues/1341
// For IE
.btn-inverse:active,
.btn-inverse.active {
background-color: #080808 \9;
}
// Add 'btn-flat' to your buttons
.btn-flat {
filter:progid:DXImageTransform.Microsoft.Gradient(enabled='false');
@kylefox
kylefox / gist:4512777
Created January 11, 2013 18:15
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@max-mapper
max-mapper / helloworld.js
Created November 27, 2012 06:55
droneduino
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})
@brentertz
brentertz / emitter.js
Created October 20, 2012 16:30
Node.js: Extend a class to be an EventEmitter
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
@ToddG
ToddG / rebar-reltool-relase-notes.md
Created September 15, 2012 16:46
using rebar to create an erlang app with a dependency, and then starting a release created with reltool

Summary

I'm trying to figure out how to use rebar to:

  • create erlang project
  • add a dependency on an erlang module from github
  • start the app via the erl console
  • create a release and start the app from the release (via the generated scripts)
# development.pp
stage { 'req-install': before => Stage['rvm-install'] }
class misc {
package {
[
'vim',
]:
ensure => installed,
}