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
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Integralist
Integralist / README.md
Created March 27, 2012 08:58 — forked from necolas/README.md
Experimenting with component-based HTML/CSS naming and patterns

Object-Oriented CSS

Below is how I am currently structuring my CSS to be more object-oriented (with a little assistence from Sass):

# This module intentionally minimizes dependencies to mitigate breakage risk.
# Subset of Syslog's numerical severity codes (RFC 3164, Table 2)
SEVERITY =
ERROR: 3
WARN: 4
INFO: 6
DEBUG: 7
# Configuration
@danshearmur
danshearmur / document_write.js
Created March 7, 2012 15:11
Replace document.write so that embedding gist script tags doesn't block the page
document._write = document.write;
document.write = function(str){
if (str.indexOf('<div id=\"gist-') != 0) {
if(str.indexOf('https://gist.github.com/stylesheets/gist/embed.css') == -1) {
// if you got this far it's not a github document.write call
document._write(str);
}
return;
}
@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
}
}
@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'
@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
@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"
@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"
);
@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