Skip to content

Instantly share code, notes, and snippets.

#!/bin/node
for (var i = 1; i <= 100 ; i++) {
console.log('gahd jeeez')
}
git remote add upstream [Clone Url]
git fetch upstream
git checkout master
## At this point, you have two options:
git merge upstream/master # Merge yours and theirs
git push origin master # Push back to your fork
git reset --hard upstream/master # Make yours look *exactly* like theirs, lose your changes;
@michealbenedict
michealbenedict / hogan.js
Created March 28, 2012 19:16
Hogan adapter with layout & partial support for express 3
'use strict';
var fs = require('fs'),
path = require('path'),
hogan = require('hogan.js'),
templateCache = {},
partials = {},
layout;
function normalisePath(name, extension){
var currentExtension = path.extname(name);
/* =============================================================
* bootstrap-typeahead-backbone.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js
* Modified by Marius Andreiana to work with Backbone Collection, Model, View
* - custom results formatting
* - custom behavior on selected item (Model with complex information)
* =============================================================
* Copyright 2012 Twitter, Inc.
*
@michealbenedict
michealbenedict / README.markdown
Created March 18, 2012 18:11
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@michealbenedict
michealbenedict / comma-first-var.js
Created March 14, 2012 15:19 — forked from isaacs/comma-first-var.js
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@michealbenedict
michealbenedict / build_b2g.markdown
Created March 5, 2012 23:29
Mozilla B2G Build for Crespo4G

Build Mozilla B2G

# remove and clean build
$ make mrproper

# Sync with main repo
$ make sync

# Make Config file for Nexus S 4G

$ make config-nexuss4g

@michealbenedict
michealbenedict / securing_rails_updates.md
Created March 5, 2012 15:18 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note this is not posted by the GitHub team or in any way associated with them team. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr.


@homakov’s explot on GitHub was simple and straightforward. Calling it an attack makes it sound malicious whereas the truth was that GitHub bolted its front door but left the hinges on quick release. Homakov released the hinges, walked in and shouted to anyone who would listen that they had a problem.

<!-- var obj = {
title: "some title",
content: "some content",
tasks: [
{task_name: "abc"},
{task_name: "bcd"}
]
};
var template = ["<h1>{{title}}</h1>"
@michealbenedict
michealbenedict / gist:1812727
Created February 13, 2012 01:58
rails stack
# main packages
sudo apt-get install build-essential libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
# create new generic deployer account
$ sudo useradd deployer
# add user to a group
$ ##
# add him to sudoers list
$ sudo vi visudoer