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 / 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 / .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 / card.js
Last active August 29, 2015 14:05
Test Card
variables.first = makeFirst(variables.first);
function makeFirst (first) {
return first + '(made)';
}
@cpsubrian
cpsubrian / .gitignore
Last active August 29, 2015 14:03
Replicate Atom-Shell Stall/Idle Problem
Atom.app
@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 / 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
// Optional `options. Stuff like retry count, ramp-up, etc.
// should have sane defaults.
var wait = waitforit(options, function (cb) {
// This would be the 'test' function.
// cb(true) when 'it' is done.
});
wait.on('ready', function () {
// Do something because the test condition passed.
@cpsubrian
cpsubrian / README.md
Last active December 17, 2015 03:19
Streams instead of ORM.

Streams instead of ORM

Pros:

  • Streams?
  • More manual query control.
  • Combine different transforms depending on use case.

Cons:

(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\
@cpsubrian
cpsubrian / README.md
Last active December 15, 2015 06:19
This would be the title!

Article Content

Using markdown:

  • Use lists
  • etc.