Skip to content

Instantly share code, notes, and snippets.

@jeffcressman
jeffcressman / macOS + homebrew + nvm + yarn setup.md
Last active April 25, 2017 00:45
Installation instructions for homebrew, nvm, and yarn

Dependencies

Install nvm and the latest stable version of node

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash

Install the version of node specified in the .nvmrc file or the Current version at https://nodejs.org/en/

nvm install 7

@jeffcressman
jeffcressman / nvm-node-init.sh
Last active February 11, 2017 04:16
For use with NVM where there is a standard set of Node packages we would like installed for any version of Node that is installed
#!/bin/bash
# Deprecated:
# nvm install node --reinstall-packages-from=node
# makes it simple to reinstall global packages from current node to latest node version
# https://github.com/creationix/nvm#migrating-global-packages-while-installing
# For use with NVM where there is a standard set of Node packages we would like installed for any version of Node that
# is installed.
@jeffcressman
jeffcressman / promises.js
Created February 25, 2016 06:33
Promise pseudo code
// Promises pseudo code that doesn't really do anything.
// The callback way
app.models.trainer.findById('sdfsdf', function(err, res){
});
// The promise way
new Promise(function(resolve, reject) {
var good = true;

Keybase proof

I hereby claim:

  • I am jeffcressman on github.
  • I am jeffcressman (https://keybase.io/jeffcressman) on keybase.
  • I have a public key whose fingerprint is 1A2A A29F 0121 BD31 1409 F2C3 BC39 ABB1 DA25 1D1A

To claim this, I am signing this object:

Verifying that +jeffcressman is my blockchain ID. https://onename.com/jeffcressman
@jeffcressman
jeffcressman / ember_examples.md
Created October 16, 2015 01:16 — forked from rwjblue/ember_examples.md
Ember Examples
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@jeffcressman
jeffcressman / index.md
Last active August 29, 2015 14:08 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@jeffcressman
jeffcressman / Handy *nix tricks
Created October 12, 2014 12:01
Handy *nix tricks
# Create an empty test file
dd if=/dev/zero of=test.zip bs=1024k count=10
Change of= to file name
Change count= to 20 for 20mb file, 100 for 1gb file
or
@jeffcressman
jeffcressman / new_bashrc.sh
Created August 11, 2012 15:35 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc