Skip to content

Instantly share code, notes, and snippets.

View cpsubrian's full-sized avatar

Brian Link cpsubrian

  • Dropbox
  • Fremont, CA
View GitHub Profile
@cpsubrian
cpsubrian / user-data.sh
Created May 2, 2014 17:20
AWS User Data for a Node.js Server
#!/bin/bash
USER=ubuntu
HOME=/home/ubuntu
# install pubkeys
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
curl --silent --location [url to an authorized keys file] > $HOME/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys
@cpsubrian
cpsubrian / keybase.md
Created May 22, 2014 22:40
keybase.md

Keybase proof

I hereby claim:

  • I am cpsubrian on github.
  • I am cpsubrian (https://keybase.io/cpsubrian) on keybase.
  • I have a public key whose fingerprint is 98C5 3702 B9D9 0B60 46B0 0E8E 4B6E 728A 3FF3 9D1C

To claim this, I am signing this object:

@cpsubrian
cpsubrian / .gitignore
Last active August 29, 2015 14:03
Replicate Atom-Shell Stall/Idle Problem
Atom.app
@cpsubrian
cpsubrian / card.js
Last active August 29, 2015 14:05
Test Card
variables.first = makeFirst(variables.first);
function makeFirst (first) {
return first + '(made)';
}
@cpsubrian
cpsubrian / .vimrc
Created June 11, 2015 00:01
vim stuff
" be iMproved, required
set nocompatible
" required
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@cpsubrian
cpsubrian / historyActions.js
Last active September 3, 2015 20:40
A stab at a redux history (undo/redo) 'transducer' utilizing Immutable.js
/**
* History action creators.
*/
import * as types from '../types'
export function resetHistory () {
return {type: types.HISTORY_RESET}
}
@cpsubrian
cpsubrian / README.md
Created September 21, 2015 19:42
Scrolly Box Pop-in

Usage

$ [clone this gist]
$ hipley --dev
$ open http://localhost:3000
``
@cpsubrian
cpsubrian / photo.js
Created July 5, 2011 07:18
Figuring out scope
// Constants
var API_HOST = 'api.instagram.com';
var API_BASE_URL = '/v1';
var CLIENT_ID = 'the id';
var CLIENT_SECRET = 'the secret';
var OAuth= require('oauth').OAuth;
var https = require('https');
var util = require('util');
@cpsubrian
cpsubrian / test.js
Created August 1, 2011 01:58
Using tobi with vows.
var vows = require('vows')
, tobi = require('tobi')
, port = 80
, host = 'www.google.com';
/**
* Topic macro to GET a url.
*/
var getUrl = function(url) {
return function() {
@cpsubrian
cpsubrian / broken-test.js
Created August 1, 2011 01:12
Figuring out tests with Tobi and Vows.
/**
* When I try to test with my app ... I get the error below.
*/
process.env['NODE_ENV'] = 'test';
var vows = require('vows'),
tobi = require('tobi'),
should = require('should'),
app = require('../app'),
conf = require('../conf');