Skip to content

Instantly share code, notes, and snippets.

Sundeep Malladi balanceiskey

Block or report user

Report or block balanceiskey

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
balanceiskey / gist:1774007
Created Feb 8, 2012
Date Math in Javascript
View gist:1774007
// calculate end day
// note, end day should be the final second
// of the final day (23:59:59) and 1 day
// before today
var end_time = parseInt(new Date().setUTCHours(23,59,59,59)/1000 - 86400, 10),
// calculate start day, x number of days before
// end day, note start day should be the start
// of the day (00:00:00)
start_time = parseInt(new Date((end_time - (days_ago * 86400)) * 1000).setUTCHours(0,0,0,0) / 1000, 10);
balanceiskey /
Created Mar 1, 2012
Simple bash function to archive a bunch of folders
for var in "$@"
if [ -z "$var" ]
echo "You must supply a folder to archive."
if [ -d $var ]
balanceiskey / badcanary.js
Created Mar 19, 2012
Canary allows bad JS.
View badcanary.js
var end_time = new Date().setUTCHours(23,59,59,59).getTime();
balanceiskey /
Created Apr 2, 2012 — forked from erikh/
OSX For Hackers
#!/usr/bin/env sh
# This is script with usefull tips taken from:
# install it:
# curl -sL | sh
View sunbolt.zsh-theme
# Sunrise theme for oh-my-zsh by Adam Lindberg (
# Intended to be used with Solarized:
# (Needs Git plugin for current_branch method)
# Modified by Sundeep Malladi to include Mercurial (and some other shtuff).
# Color shortcuts
balanceiskey / ffextension.js
Created Jan 30, 2013
An example of how to get Backbone Models and Collections working in a firefox extension.
View ffextension.js
var Request = require('request').Request,
_ = require('./underscore'),
Backbone = require('./backbone'),
// Firefox Add-Ons cannot use jQuery in the background
// script, but there are instances where we need some
// jquery functionality, paricularly $.ajax, which
// is defined later.
$ = {
ajax: function (params) {
if (!params.url){
balanceiskey / schemeflip.vim
Last active Dec 20, 2015
A simple vim function to flip between your preferred dark and light color schemes.
View schemeflip.vim
noremap <silent> <leader>l :call FlipScheme()<cr>
function! FlipScheme()
if g:colors_name == 'hemisu'
set background=dark
color jellybeans
set background=light
color hemisu
View ns-cheatsheet.clj
;; * :require makes functions available with a namespace prefix.
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;; * :import refers Java classes to the current namespace.
View subtle.js
define ( ['somewhere/someFunc'], function (someFunction) {
return someFunction(anotherFunction);
function anotherFunction() {
// stuff
balanceiskey / twitterbookmarklet
Created Feb 19, 2014
Bookmarklet for revealing twitter id while on twitter page
View twitterbookmarklet
javascript:(function()%7Bvar profileCardInner%3Ddocument.getElementsByClassName(%27profile-card-inner%27),jsTopbar,userId,div%3Bif(profileCardInner%26%26profileCardInner.length)%7BprofileCardInner%3DprofileCardInner%5B0%5D%3BuserId%3DprofileCardInner.dataset.userId%3Bdiv%3Ddocument.createElement(%27div%27)"0.8""33px""100%25""fixed""0""0""999""20px""white""13px""center"%3BjsTopbar%3Ddocument.getElementsByClassName(%27js-topbar%27)%3Bif(jsTopbar.length)%7BjsTopbar%3DjsTopbar%5B0%5D%3BjsTopbar.insertBefore(div,jsTopbar.firstChild)%3B%7D%7D%7D)()%3B
You can’t perform that action at this time.