This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery live() and die() plugin for newer version jQuery (version newer than 1.7) | |
// meant to facilitate gradual upgrade of old jQuery code to a newer version | |
jQuery.fn.live = function (eventTypes, eventHandler) { | |
var that = $(this); | |
$(document).on(eventTypes, that['selector'], eventHandler); | |
return that; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add the following in ~/.config/fish/config.fish | |
# ~/.run-tmux.sh | |
# TMUX | |
if which tmux >/dev/null 2>&1; then | |
#if not inside a tmux session, and if no session is started, start a new session | |
test -z "$TMUX" && (tmux -2 attach || tmux -2 new-session) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable activity alerts | |
setw -g monitor-activity on | |
set -g visual-activity on | |
# clock | |
set-window-option -g clock-mode-colour green #green | |
# reload config | |
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac OSX Files | |
.DS_Store | |
.AppleDouble | |
.LSOverride | |
# Thumbnails | |
._* | |
# Files that might appear in the root of a volume | |
.DocumentRevisions-V100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a modified version of similar functions found here: | |
// http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery | |
// http://jsperf.com/hashing-strings | |
String.prototype.hash = function () { | |
var res = 0, | |
len = this.length; | |
for (i = 0; i < len; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function does the following: | |
// + Thing 1 | |
// + Thing 2 | |
// + Thing 3 | |
// | |
// It takes the following parameters: | |
// + Parameter 1 | |
// + Parameter 2 (Optional) | |
// | |
// It returns: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* reset certain element to basic styling */ | |
/* source: http://stackoverflow.com/questions/15901030/reset-remove-css-styles-for-element-only */ | |
/* CSS3 way */ | |
.reset-this { | |
all: unset; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: https://github.com/mbostock/d3/wiki/API-Reference | |
d3 (core) | |
Selections | |
d3.select | |
select an element from the current document. | |
d3.selectAll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the function is only run after the resize has ended | |
var timeout; | |
window.onresize = function(){ | |
clearTimeout(timeout); | |
timeout = setTimeout(function () { | |
// do wonderful things here |