Skip to content

Instantly share code, notes, and snippets.

View brian-lc's full-sized avatar

Brian Chamberlain brian-lc

View GitHub Profile
@brian-lc
brian-lc / gist:5688218
Created May 31, 2013 21:46
Block of my Vagrantfile
config.vm.provision :chef_solo do |chef|
chef.data_bags_path = "data_bags"
chef.add_recipe "apt"
chef.add_recipe "nginx"
chef.add_recipe "repstar"
chef.log_level = :debug
chef.json = {
:user => {
'name' => 'deployer',
'password' => '$1$qB9l7UaP$AJivltdJXXcMJacaAAc97/'
-module(net_led).
-export([start/1, loop/1]).
%% starting our LED listening process
start(Pin) ->
io:format("Led on pin ~p is listening...~n", [Pin]),
LedPin = led:start(Pin),
spawn(net_led, loop, [LedPin]).
@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},
@brian-lc
brian-lc / cat3_export1.xml
Last active December 19, 2015 14:09
First CAT3 export from PopHealth
<?xml version="1.0" encoding="utf-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:hl7-org:v3"
xmlns:cda="urn:hl7-org:v3">
<!--
********************************************************
CDA Header
********************************************************
-->
@brian-lc
brian-lc / gist:6257138
Created August 17, 2013 14:29
package.json examples
Searching 1741 files for ""eventemitter2":"
/Users/brian/Projects/ifttt/indra/node_modules/milo/node_modules/forever/package.json:
48 "devDependencies": {
49 "broadway": "0.2.x",
50: "eventemitter2": "0.4.x",
51 "request": "2.x.x",
52 "vows": "0.7.x"
/Users/brian/Projects/ifttt/indra/node_modules/milo/node_modules/forever/node_modules/flatiron/node_modules/broadway/package.json:
@brian-lc
brian-lc / nested_logic_test.js
Created August 22, 2013 19:06
Testing the difference between nested if and if A && B
var a = function(err){
if (err && err.code === "ETIMEDOUT") {
return true;
}
return false;
}
var b = function(err){
if (err) {
@brian-lc
brian-lc / gist:6380896
Last active December 21, 2015 23:18
redis checks

== Ruby Redis == Using rails console:

# setting up access to redis:
redis_config = YAML.load_file(Rails.root.join('config/resque.yml'))
server = redis_config[Rails.env]
host, port, db = server.split(':')
redis = Redis.new(:host => host, :port => port, :thread_safe => true, :db => db)  
@brian-lc
brian-lc / results.html
Last active December 23, 2015 18:49
Scatter plot
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
mantis:devenv brian$ git co railsexpress_default
Branch railsexpress_default set up to track remote branch railsexpress_default from origin.
Switched to a new branch 'railsexpress_default'
mantis:devenv brian$ mv Devenvfile myDevenvfile
mantis:devenv brian$ my Devenvfile.example Devenvfile
-bash: my: command not found
mantis:devenv brian$ mv Devenvfile.example Devenvfile
mantis:devenv brian$ vim Devenvfile
mantis:devenv brian$ ./bin/reinstall
[default] VM not created. Moving on...
Installing thrift (0.8.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/brian/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for strlcpy() in string.h... yes
creating Makefile
make "DESTDIR="
compiling binary_protocol_accelerated.c
compiling compact_protocol.c