Skip to content

Instantly share code, notes, and snippets.

ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@aCandidMind
aCandidMind / .mongorc.js
Created November 6, 2015 09:29 — forked from yanatan16/.mongorc.js
My .mongorc.js file
(function () {
rcversion = '1.0';
load('underscore.min.js')
// NOTES
// Basics, wrap the whole thing in a function
// Set a version for sanity's sake
// Load underscore, a must in any javascript environment
@aCandidMind
aCandidMind / 1-setup-server.md
Created December 8, 2015 13:19 — forked from johnlpage/1-setup-server.md
Data Loading and Aggregation demo in MongoDB

#Start a machine use any method you like here, I'm doing it from the command line 40 cores, 120GB RAM, SSD with 8,500 IOPS (SAN) - Amazon linux (Centos)

ec2-run-instances ami-a10897d6 -t m4.10xlarge -g jlp -k john_page_demos -b "/dev/xvdb=:725:true:io1:8500"

#Log on

ssh -L 27017:localhost:27017 -i <your public key>.pem ec2-user@<your ip address>

#Set up disk

@aCandidMind
aCandidMind / Procfile
Last active January 6, 2016 17:05 — forked from czottmann/Procfile
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
@aCandidMind
aCandidMind / gist:5192e23317501e62c51ecc7dd0744ead
Created April 24, 2016 10:25 — forked from c089/gist:ed08d81993f42d2f56bf
beating impurity in redux applications using dependency injection
/* First, since our reducers need to be free of side-effects, we move them to an
action creator. Note the double arrow function: The outer function is only there
dependency injection. It's a function that creates an action creator, but I
don't really want to call it an action creator creator ;) */
const impureActionCreator = (idGenerator) => () => ({type: 'FOO_ACTION', id: randomSource.randomId()});
// Our reducer will now stay free of side effects, and we already have `action.id` when it's called
const reducer = (state, action) => // ...
// we can unit test our action creator by injecting a pure stub
@aCandidMind
aCandidMind / install.sh
Created May 2, 2016 14:42 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@aCandidMind
aCandidMind / gist:52a0161d476a1f42154352c9614a2d82
Last active May 17, 2016 08:35 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git pull # very important, as per https://gist.github.com/lttlrck/9628955#gistcomment-1440927
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@aCandidMind
aCandidMind / add-docker-user.sh
Created June 2, 2016 16:40 — forked from bruth/add-docker-user.sh
Setup Official Docker Repo on RHEL 7
#!/bin/bash
/usr/sbin/usermod -aG docker <user>
@aCandidMind
aCandidMind / events.js
Created June 13, 2016 13:39 — forked from findjashua/events.js
Get streams for interaction & mutation events
import {Observable} from 'rx';
import {DOM} from 'rx-dom';
import {toArray, getNodesFromSelector} from './utils';
let interactions_ = {
'click': Observable.fromEvent(document.body, 'click')
}
let mutations_ = DOM