Skip to content

Instantly share code, notes, and snippets.

View aoberoi's full-sized avatar
👷‍♂️
Under construction

Ankur Oberoi aoberoi

👷‍♂️
Under construction
View GitHub Profile
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
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",
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@tomshaw
tomshaw / oauth_twit_consume_example.js
Created July 2, 2011 14:54
Some Node.js Express, Jade, examples using Node-OAuth querying protected Twitter consumer resources.
function consumer() {
return new oauth.OAuth(
"https://twitter.com/oauth/request_token",
"https://twitter.com/oauth/access_token",
keys.twitterConsumerKey,
keys.twitterConsumerSecret,
"1.0A",
"http://localhost:3000/sessions/callback",
"HMAC-SHA1"
);
@kenperkins
kenperkins / clipboard-app.conf
Created August 22, 2011 20:36
Clipboard.com Upstart script for Node
#!upstart
description "clipboard.com app server"
author "Ken Perkins & Mark Dawson (c) 2011"
env NAME=clipboard-app
env APP=clipboard-app.js
env LOGFILE=/home/clipboard/clipboard-app.log
env ERRORFILE=/home/clipboard/clipboard-app-error.log
env HOME="/home/clipboard/node/apps"
@xjones
xjones / TransitionController.h
Created November 26, 2011 03:48
TransitionController for animating iOS view controller transitions w/o a controller stack
//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController
@ericdagenais
ericdagenais / Rakefile
Last active February 21, 2018 00:36 — forked from oppara/Rakefile
Titanium Mobile Rakefile Build and TestFlight API Script for iOS
DEV_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
DEV_SIGN = 'Your Signing Name'
ADHOC_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
ADHOC_SIGN = 'Your Signing Name'
DEV_APP_DEVICE = 'ipad' # or iphone, universal
IPHONE_SDK_VERSION = '5.0'
@onlytracks
onlytracks / gist:1951021
Created March 1, 2012 16:25
JavaScript Mixin Pattern
var Person = function(name) {
this.name = name
}
var GreeterMixin = function() {
this.greet = function(name) {
return "Hello " + name + ", I am " + this.name
}
}