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
{"account_id_migration_state":2,"account_tracker_service_last_update":"13113367308835242","browser":{"clear_lso_data_enabled":true,"pepper_flash_settings_enabled":true,"window_placement":{"bottom":835,"docked":false,"left":10,"maximized":false,"right":1060,"top":40,"work_area_bottom":845,"work_area_left":0,"work_area_right":1600,"work_area_top":30}},"countryid_at_install":21843,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","727454"],"daily_original_length_application":"450173","daily_original_length_unknown":"26","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0 |
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
/* | |
Example cars.csv: | |
Year,Make,Model,Length | |
1997,Ford,E350,2.34 | |
2000,Mercury,Cougar,2.38 | |
*/ | |
d3.csv('cars.csv', function(data) { |
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
(function (document) { | |
ArrayForEach = Array.prototype.forEach || function (callback, scope) { for (var i = 0, l = this.length; i < l; ++i) callback.call(scope, this[i], i, this); }; | |
function updateElements() { | |
var skip = document.hidden || document.mozHidden || document.msHidden || document.oHidden || document.webkitHidden || !document.hasFocus || document.hasFocus(); | |
ArrayForEach.call(document.querySelectorAll("html,link[rel],script[src]"), function (element) { | |
if (skip) { | |
return; | |
} |
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
// what does this do?: | |
(function(){ | |
var i = 5; | |
}()); | |
// What this does is create an anonymous function then assigns a local variable 'i' | |
// with an integer value of 5 to it. Then it runs the function. |
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
// I was bored. | |
// Sorry :( | |
function d(id){ return document.getElementById(id); } | |
window.onload = function(){ | |
var email_only = d('email_only'), | |
mail_only = d('mail_only'), | |
phone_only = d('phone_only'); | |
mail_only.style.display = phone_only.style.display = 'none'; | |
d('contact_us_stype_email').onclick = function () { |
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 image magnifier; jdbartlett's rewrite of Chris Iufer's jLoupe | |
// $('<a href="bigimage.jpg"><img src="smallimg.jpg"></a>').loupe(); | |
// code: http://gist.github.com/252303 - demo: http://jsbin.com/olado3 | |
(function($) { | |
$.fn.loupe = function(options) { | |
if (!this.length) return this; | |
options = $.extend({ | |
loupe: 'loupe', | |
width: 200, | |
height: 150 |
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
(?xi) | |
\b | |
( # Capture 1: entire matched URL | |
(?: | |
[a-z][\w-]+: # URL protocol and colon | |
(?: | |
/{1,3} # 1-3 slashes | |
| # or | |
[a-z0-9%] # Single letter or digit or '%' | |
# (Trying not to match e.g. "URI::Escape") |
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
// If you want to flip a variable from true to false, you can do the following: | |
var x = false; | |
x = !!(x-1); | |
// At this point, x is true. | |
// Let's say you want to flip 0 to 1 or 1 to 0: | |
var y = 1; |
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
# Rename an email address in all old commits. | |
# WARNING: Will change all your commit SHA1s. | |
# Based off of the script from here: | |
# http://coffee.geek.nz/how-change-author-git.html | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]; | |
then | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
GIT_COMMITTER_EMAIL="[email protected]"; | |
git commit-tree "$@"; |
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
if has('win32') | |
set backupdir=C:/cygwin_updated/var/vim/backup | |
set directory=C:/cygwin_updated/var/vim/tmp | |
elseif has('win32unix') | |
if exists("*mkdir") | |
if !isdirectory('/var/vim/') | |
mkdir('/var/vim/') | |
endif | |
if !isdirectory('/var/vim/backup/') | |
mkdir('/var/vim/backup/') |
NewerOlder