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
#!/usr/bin/ruby | |
# Dropzone Destination Info | |
# Name: GitHub Gist | |
# Description: Drag text or files to share them instantly via GitHub Gist. Hold down option to make a public Gist. Click to copy and goto the last URL. | |
# Handles: NSStringPboardType, NSFilenamesPboardType | |
# Events: Clicked, Dragged | |
# KeyModifiers: Option | |
# Creator: Justin Hileman | |
# URL: http://justinhileman.com |
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
tell application "Microsoft Outlook" | |
set thisAccount to item 1 of imap accounts | |
set destFolder to folder "Hewlett-Packard" | |
set messageSet to current messages | |
repeat with currMsg in messageSet | |
move currMsg to destFolder | |
end repeat | |
end tell |
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
#!/usr/bin/env python | |
import re | |
import sys | |
from optparse import OptionParser | |
def main(): | |
commandLine = OptionParser() | |
commandLine.add_option("-f", "--file", type="string", dest="filename", | |
help="Read from specific FILE", action="store", metavar="FILE") |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
const deltaCorrectionThreshold = .000000000000000005 | |
var NewtonSquareRootRecursive func(float64, float64) float64 |
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
group1Population = 577958 | |
group1Measured = 6015 | |
group2Population = 235568 | |
group2Measured = 2115 | |
data.table = matrix( | |
c(group1Population,group1Population-group1Measured, # Row 1 | |
group2Population,group2Population-group2Measured), # Row 2 | |
nrow=2, # number of rows | |
ncol=2, # number of columns |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. |
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
#!/usr/bin/env python | |
# Original taken from https://developers.google.com/youtube/analytics/v1/code_samples/python | |
# Prereq Installs: | |
# pip install httplib2 | |
# pip install apiclient | |
# pip install urllib3 | |
# pip install --upgrade google-api-python-client | |
# pip install --upgrade oauth2client |
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
#!/usr/bin/env python | |
import fileinput | |
import re | |
import math | |
import pprint | |
import sqlite3 | |
def getWords(str): | |
splitter = re.compile(r"\W*") |
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
function trigger() { // Used as a custom trigger for EDLs | |
console.log("PROMISE: Initiating Promise"); | |
var p = Bootstrapper.when.defer(); | |
var waitTime = 10; // Default MS to wait until resolved | |
(function waitForResolution() { | |
console.log("PROMISE: Waiting for value TestDataTrigger to exist: " + waitTime); | |
waitTime = waitTime * 2; // Exponential Backoff - wait longer and longer between calls | |
if(!window.TestDataTrigger) { | |
setTimeout(waitForResolution,waitTime); | |
} else { |
OlderNewer