Skip to content

Instantly share code, notes, and snippets.

Vishal Telangre vishaltelangre

Block or report user

Report or block vishaltelangre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pubsub-simple.js
var pubsub = {};
(function(q) {
var topics = {}, subUid = -1;
q.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
var token = (++subUid).toString();
token: token,
View konklone.advanced.conf
server {
listen 80;
return 301 https://$host$request_uri;
# optional: the 'spdy' at the end of the listen command below turns on SPDY support.
server {
listen 443 ssl spdy;
View jquery.waituntilexists.js
(function ($) {
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
View snippet.js
* Updated to use the function-based method described in
* Better handling of scripts without supplied ids.
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
View gist:5772520
[1, 1, 1, 1, 2, 2, 3].to_histogram
=> {1 => 3, 2 => 2, 3 => 1}
vishaltelangre / dynamic_selector_name.scss
Last active Dec 15, 2015 — forked from nex3/gist:1163471
Setting selector name dynamically in SASS
View dynamic_selector_name.scss
@mixin active($selector) {
#{$selector} {
#my-id {
@include active($selector: ".my-class")
View gist:5125438
require "nokogiri"
require "uri"
require "net/http"
UA = "Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/18.0 Firefox/18.0 FirePHP/0.7.1"
@cookie = {}
def request(address, method = :get, data = {})
uri = URI.parse(address)
http =, uri.port)
View gist:5125262


Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using here.

Initial setup

You can’t perform that action at this time.