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
Array.prototype.repeat = function(times, each) { | |
if(!times){return this;} | |
if(!each){each=1;} | |
var that = this; | |
var temp=Array(each*this.length); | |
this.forEach(function(el, i){ | |
for(j = 0; j < each; j++){ | |
temp[i * each + j] = el; | |
} | |
}); |
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 htmlreplace(element){ | |
var nodes=element.childNodes; | |
for(var n=0;n<nodes.length;n++){ | |
if(nodes[n].nodeType==3){ | |
var r=new RegExp('[pP][^A-Za-z0-9]+[vV]alue', 'gi'); | |
if(nodes[n].textContent){ | |
nodes[n].nodeValue=nodes[n].textContent.replace(r,'P. Funk'); | |
}else{ | |
nodes[n].nodeValue=nodes[n].nodeValue.replace(r,'P. Funk'); | |
} |
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
library(devtools) | |
devtools::install_github("dplyr") | |
library(dplyr) | |
devtools::install_github("bigrquery") | |
library(bigrquery) | |
billingID <- "Insert Your Project's Billing ID Here" | |
gdelt <- src_bigquery(billingID, "GDELT") | |
events <- tbl(gdelt, "events") |
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
desc | brand | size | proof | price | alcohol_ml | shot_equiv | cents_per_shot | display_vol | abv | bpd | |
---|---|---|---|---|---|---|---|---|---|---|---|
BEER | Lionshead Pilsner | 58673.8 | 9 | 84.99 | 2640 | 155.2941176 | 57.10376125 | 1/2 Keg | 4.5 | 1.751264854 | |
BEER | Pabst | 58673.8 | 9 | 89.99 | 2640 | 155.2941176 | 60.46320125 | 1/2 Keg | 4.5 | 1.653961552 | |
BEER | Budweiser | 58673.8 | 9 | 99.99 | 2640 | 155.2941176 | 67.18208125 | 1/2 Keg | 4.5 | 1.488548854 | |
BEER | Bud Light | 58673.8 | 8.4 | 99.99 | 2464 | 144.9411765 | 71.98080135 | 1/2 Keg | 4.2 | 1.389338934 | |
BEER | Miller Lite | 58673.8 | 8.4 | 99.99 | 2464 | 144.9411765 | 71.98080135 | 1/2 Keg | 4.2 | 1.389338934 | |
BEER | Coors Light | 58673.8 | 8.4 | 99.99 | 2464 | 144.9411765 | 71.98080135 | 1/2 Keg | 4.2 | 1.389338934 | |
BEER | Yuengling Traditional Lager | 58673.8 | 9 | 124.99 | 2640 | 155.2941176 | 83.9792813 | 1/2 Keg | 4.5 | 1.190815266 | |
BEER | Michelob Ultra | 58673.8 | 8.4 | 129.99 | 2464 | 144.9411765 | 93.5772014 | 1/2 Keg | 4.2 | 1.068697592 | |
BEER | Yuengling Traditional Lager | 29336.9 | 9 | 66.99 | 1320 | 77.64705882 | 90.0192476 | 1/4 Keg | 4.5 | 1.110912076 |
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
import glob, slate | |
for filename in glob.glob( '*.pdf' ): | |
with open(filename) as f: | |
doc = slate.PDF(f) | |
fileout = open(filename.rstrip('.pdf')+'.txt', 'w+') | |
fileout.writelines(doc) |
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
############################################################ | |
## Title: Animated Beating Heart in R | |
## Author: Jared Knowles | |
## Forked: Tony Boyles | |
## Date: February 14, 2014 | |
############################################################ | |
library(animation) | |
library(ggplot2) |
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
<?php | |
//console.php | |
// An itty-bitty Oracle DB Console written in PHP. | |
// Copyright 2014 By [Tony Boyles]<[email protected]> (http://aaboyles.com) | |
// Licensed under the GPL v3 or later. | |
//Edit these Credentials to match your Oracle Database's | |
$dbuser = ''; | |
$dbpass = ''; | |
$dbhost = '127.0.0.1'; |
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 table2CSV(table, delim){ | |
var csv = "data:application/csv;charset=utf-8,"; | |
if(table instanceof HTMLElement){ | |
table = $(table); | |
} | |
if(table instanceof jQuery){ | |
var regex = /,/g; | |
if(delim){ | |
regex = new RegExp(delim, 'g'); | |
delim = encodeURIComponent(delim); |
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
/* | |
You can create a spinner using either of the variants below: | |
$("#el").spin(true); //Starts the spinner. | |
$("#el").spin(false); // Kills the spinner. | |
*/ | |
(function($) { | |
$.fn.spin = function(opts) { |
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
require(RCurl) | |
gDocs <- "https://docs.google.com/spreadsheet/pub?key=0AuRPH1hRlnZhdEhtbGtZWTRybThvNXBLZW15Vk1Lenc&single=true&gid=0&output=csv" | |
txCon <- textConnection(getURL(gDocs)) | |
FSI <- read.csv(txCon) |