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
export UA_PROP='UA-XXXXX-Y' # Your UA property ID | |
export UA_CLIENT='wesalvaro' # A unique client (i.e. user) ID | |
alias ua_collect="curl www.google-analytics.com/collect -s -o /tmp/ua_collect --data v=1 --data tid=$UA_PROP --data cid=$UA_CLIENT" | |
# Tracks any "event" type. | |
function track_evt { | |
local category=$1 | |
local action=$2 | |
local value=$3 # integer | |
local label=$4 |
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
$('a[href*=downloadSong]').each(function() { | |
$('<iframe />').attr('src', $(this).attr('href')).appendTo('body'); | |
}); |
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
# http://supernintendopi.wordpress.com/ | |
sudo apt-get update | |
sudo apt-get upgrade -y git | |
sudo apt-get install -y git dialog | |
# http://ledgerlabs.us/raspberrypi/xboxdrv-using-xbox-controllers/ | |
sudo apt-get install xboxdrv | |
sudo cat << EOF >> /etc/rc.local | |
xboxdrv --daemon --detach --detach-kernel-driver --silent --dbus disabled \ | |
--next-controller --next-controller \ |
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
/* | |
A Google Apps Script for reporting your Inbox Zero progress/procrastination. | |
https://gist.github.com/wesalvaro/01cc403b92ab91ac622e | |
Installation: | |
1. Use this file to create a new Google Apps Script. | |
2. Run the `checkInboxThreadCount` function in your new app to authorize it. | |
3. Setup a trigger to run the `checkInboxThreadCount` function however you like. | |
4. Deploy your script as a web app. | |
Note: The app should be set to run as _you_. |
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
import csv | |
import re | |
import sys | |
import pprint | |
PRINT_VOTES = False | |
PRINT_OPTIONS = False | |
OPTION_PATTERN = r'.*\[(.*?)\].*' | |
VOTE_TEXTS = { |
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
#include <Max3421e.h> | |
#include <Usb.h> | |
#include <Max3421e_constants.h> | |
#include <AndroidAccessory.h> | |
AndroidAccessory acc("Google", | |
"Light Runner", | |
"LED Controller.", | |
"1.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
Array.prototype.wiggleSort = function() { | |
for (let i = 0; i < this.length - 1; ++i) { | |
const shouldNotBeLessThan = i % 2; | |
const isLessThan = this[i] < this[i + 1]; | |
if (shouldNotBeLessThan && isLessThan) { | |
[this[i], this[i + 1]] = [this[i + 1], this[i]]; | |
} | |
} | |
return this; | |
}; |
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
INDEX_BFS = 0 | |
INDEX_DFS = -1 | |
NOOP = lambda x: None | |
def traverse(graph, nodes, callback, index): | |
visited = set() | |
while nodes: | |
node = nodes.pop(index) | |
if node not in visited: |
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
reText = prompt('RegExp?'); | |
backgroundColor = 'rgba(255,255,80,0.5)'; | |
outline = `3px solid ${backgroundColor}`; | |
matchClass = 're-match'; | |
{ // clear old matches |
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
const it = function(a) { | |
return new Aarray(a2g(a)); | |
}; | |
const a2g = function*(a) { | |
for (let v of a) { | |
yield v; | |
} | |
}; |
OlderNewer