This file contains 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 |
This file contains 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 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 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 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 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 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 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 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 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
orem ipsum dolor sit amet, consectetur adipiscing elit. Etiam feugiat iaculis odio, sit amet gravida est suscipit vitae. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec rutrum, odio blandit malesuada facilisis, nibh nisl varius lacus, vitae pulvinar eros purus tincidunt enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris varius mauris sed tellus volutpat pharetra. Duis porta fringilla justo, non suscipit ipsum pretium eu. Morbi consequat dapibus massa eget tempor. Curabitur sed velit nec dolor elementum facilisis. In hac habitasse platea dictumst. Cras vitae justo nec purus iaculis congue. Integer consequat arcu vel ipsum hendrerit facilisis. Sed bibendum diam vitae nulla tincidunt interdum. Maecenas sagittis ligula at ipsum scelerisque a dictum erat pharetra. Cras faucibus gravida vulputate. | |
Ut eleifend, lectus non viverra dapibus, quam erat dignissim diam, sed porta mauris velit vitae felis. Morbi sit amet ma |
OlderNewer