Skip to content

Instantly share code, notes, and snippets.

View karbassi's full-sized avatar
🌱

Ali Karbassi karbassi

🌱
View GitHub Profile
{"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
@karbassi
karbassi / d3.csv.js
Last active August 29, 2015 13:57 — forked from robdodson/d3.csv.js
/*
Example cars.csv:
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
*/
d3.csv('cars.csv', function(data) {
@karbassi
karbassi / updateElements.js
Created November 8, 2012 00:15 — forked from jonathantneal/updateElements.js
Update the visible-but-unfocused tab's page, styles, and scripts without ever pressing refresh.
(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;
}
// 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.
// 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 () {
// 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
(?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")
// 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;
# 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 "$@";
@karbassi
karbassi / .vimrc
Created October 12, 2008 18:18 — forked from fc/gist:16331
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/')