Skip to content

Instantly share code, notes, and snippets.

View RATTLESNAKE-VIPER's full-sized avatar

Gautam RATTLESNAKE-VIPER

  • Mumbai,Maharashtra,India
View GitHub Profile
@kurokikaze
kurokikaze / server.js
Created May 5, 2010 09:24
Simple work queue implementation for node.js
var net = require('net'),
sys = require('sys');
var messages = [];
var work_in_progress = [];
var host = '192.168.175.128';
var port = 8999;
var server = net.createServer(function(client_stream) {
@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate
@cwestin
cwestin / aggregate.js
Created May 26, 2011 18:34
Mongo shell script and sample documents used for my aggregation talk at MongoSF
/* sample aggregate command queries */
// make sure we're using the right db; this is the same as "use mydb;" in shell
db = db.getSisterDB("aggdb");
// just passing through fields
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
@nelstrom
nelstrom / mongo-mapreduce.coffee
Created August 31, 2011 13:43
A map reduce function that counts the requests for each path on each day.
db.receipts.ensureIndex({issued_at: 1})
map = ->
day = @issued_at;
data =
count: 1
paths: {}
data.paths[@path] = {count:1}
emit(day, data);
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mikebob
mikebob / SPXFrameScroller.h
Created October 24, 2011 11:27
Custom UIScrollView that supports pinch and double tap zooming
//
// SPXFrameScroller.h
// SmartyPix
//
// Created by Mike Bobiney on 8/23/11.
// Copyright 2011 Tap Through Apps LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@jamztang
jamztang / LICENSE
Created March 26, 2012 14:40
JTTargetActionBlock - Adding blocks support for UIControl target/action mechanism
Copyright (c) 2013 Jamz Tang <jamz@jamztang.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@necolas
necolas / gist:2215692
Created March 27, 2012 13:12
Git submodules
# Workflow from https://github.com/necolas/dotfiles
# Add the new submodule
git submodule add git://example.com/remote/path/to/repo.git vim/bundle/one-submodule
# Initialize the submodule
git submodule init
# Clone the submodule
git submodule update
# Stage the changes
git add vim/bundle/one-submodule
@ses4j
ses4j / incrementalmr.py
Created March 29, 2012 03:42
Periodically-updating pymongo/MongoDB incremental MapReduce example
def incremental_map_reduce(
map_f,
reduce_f,
db,
source_table_name,
target_table_name,
source_queued_date_field_name,
counter_table_name = "IncrementalMRCounters",
counter_key = None,
max_datetime = None,
@RATTLESNAKE-VIPER
RATTLESNAKE-VIPER / Git Commands Quick Lookup
Created July 29, 2012 15:18
Git Commands Quick Lookup
-----------------------------------------------SET UP GIT-----------------------------------------------
Username:
git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit
Email:
git config --global user.email "your_email@youremail.com"
# Sets the default email for git to use when you commit
# Your email address for Git should be the same one associated with your GitHub account.