Skip to content

Instantly share code, notes, and snippets.

View jackfranklin's full-sized avatar

Jack Franklin jackfranklin

View GitHub Profile
@hmarr
hmarr / gitsh
Last active August 29, 2015 13:56
Apparently percent signs are the new cool
#!/bin/bash
echo -n "gitsh% "
while read line; do
if [[ "$line" == ":exit" ]]; then
exit
fi
sh -c "git $line"
echo -n "gitsh% "
@rmurphey
rmurphey / gist:1329222
Last active September 27, 2015 20:47
New computer setup notes

Bootstrap

  • Run software update
  • Download & install XCode in App Store
  • Install Google Chrome and enable syncing -- ensure 3rd party cookies are disabled
  • Install homebrew
  • brew install git
  • brew install wget
  • Copy ssh keys
  • git clone git@github.com:rmurphey/dotfiles.git
@ryanflorence
ryanflorence / jshint-and-vim.md
Created November 2, 2011 18:29
Get jshint running on write (save) with VIM
  1. Download [jshint.vim][jshint]

  2. Put it in ~/.vim/plugin/jshint.vim

  3. Edit your local vimrc file (I'm on macvim with janus, so it's at ~/.gvimrc.local) and add:

    au BufWritePost *.js :JSHint
  4. Read the [vim docs][vim] and particularly [auto commands][auto] I'm a newb and the neckbeards are probably laughing at me for even posting this.

@padolsey
padolsey / cat.js
Created December 4, 2011 19:00
Improving Jeremy Keith's CAT news example from http://24ways.org/2011/conditional-loading-for-responsive-designs
var cat = {};
/**
* cat.NewsBox
* Retrieves news from Google
*/
cat.NewsBox = (function(){
function NewsBox(searchTerm, injectFn) {
this.searchTerm = searchTerm;
@ikennaokpala
ikennaokpala / Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
Created December 17, 2011 16:11
Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
#Steps to install RVM + Ruby 1.9.2 + Rails + nginx + Passenger on CentOS (tested on v5.5)
# Install git and curl, if not already installed
sudo yum install git
sudo yum install curl
# Create the rvm group and add any users who will be using rvm to the group
sudo su -
groupadd rvm
@jamierumbelow
jamierumbelow / currencies.json
Created January 5, 2012 11:34
A simple currency helper for PHP. Includes clever display and currency conversion.
{
"aed": {
"priority": 100,
"iso_code": "AED",
"name": "United Arab Emirates Dirham",
"symbol": "د.إ",
"subunit": "Fils",
"subunit_to_unit": 100,
"symbol_first": true,
"html_entity": "",
@paulrouget
paulrouget / es6.js
Last active October 6, 2015 07:07
Some ECMAScript 6 element are available in Firefox
// To test this code in Firefox, I encourage you to use Firefox Aurora
// and to include your script this way:
// <script type="application/javascript;version=1.8">
// (necessary to make `let` work)
/* let ********************************************* */
// let is the new var :)
// Declares a block scope local variable
@alexbilbie
alexbilbie / gist:3169400
Created July 24, 2012 11:02
Food you should always have in

Basics

  • Tin/carton chopped tomatoes
  • Tube of tomato puree
  • White onions
  • Red onions
  • Garlic
  • New potatoes
  • Easy cook rice
  • Risotto rice
@mxriverlynn
mxriverlynn / foo.md
Created August 20, 2012 21:43
constructor dependencies vs setters

I'm re-evaluating my thoughts on constructor based dependencies vs setter dependencies in JavaScript. I'm trying to see if the same reasons we avoid setter injection in static language like C# and Java still apply in JavaScript.

In other words, why is this:

var a = new A();
var b = new B();

var c = new C(a, b);
@jcoglan
jcoglan / tweets.js
Last active December 15, 2015 16:48
// This is in response to https://gist.github.com/Peeja/5284697.
// Peeja wanted to know how to convert some callback-based code to functional
// style using promises.
var Promise = require('rsvp').Promise;
var ids = [1,2,3,4,5,6];
// If this were synchronous, we'd simply write: