Skip to content

Instantly share code, notes, and snippets.

View monkeycycle's full-sized avatar

Michael Pereira monkeycycle

View GitHub Profile
@monkeycycle
monkeycycle / loess.js
Last active August 29, 2015 14:21 — forked from avibryant/loess.js
//adapted from the LoessInterpolator in org.apache.commons.math
function loess_pairs(pairs, bandwidth)
{
var xval = pairs.map(function(pair){return pair[0]});
var yval = pairs.map(function(pair){return pair[1]});
console.log(xval);
console.log(yval);
var res = loess(xval, yval, bandwidth);
console.log(res);
return xval.map(function(x,i){return [x, res[i]]});
@monkeycycle
monkeycycle / README.md
Last active August 29, 2015 14:24 — forked from danriti/README.md
Git deploy to anywhere

Instructions

Put your ssh key on the server:

$ ssh-copy-id username@remote-server.org

On the server, create a bare git repo:

$ mkdir website.git
@monkeycycle
monkeycycle / scrape.js
Last active August 29, 2015 14:25 — forked from kevinohara80/scrape.js
Simple node.js WSJ Prime Rate scraper web service
var express = require('express');
var http = require('http');
var path = require('path');
var request = require('request');
var $ = require('cheerio');
var WSJ_PRIME_URL = 'http://www.bankrate.com/rates/interest-rates/wall-street-prime-rate.aspx';
var app = express();
@monkeycycle
monkeycycle / gulp-config.js
Last active August 29, 2015 14:26
Gulp Build Starter
var src = 'src/',
dest = 'dist/',
tmp = 'tmp/',
htmlFiles = [ src + '*.html' ],
htmlTemplates = [ src + 'tpl/*.html' ],
appData = [ src + 'data/*' ],
fontFiles = [ src + 'fonts/*' ],
mediaPath = [ src + 'images/*' ],
appJS = [ src + 'scripts/main.js'];
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@monkeycycle
monkeycycle / spreadsheet-to-ft
Created April 5, 2012 07:25 — forked from chrislkeller/README.md
Script to bring Google spreadsheets and Fusion Tables closer together
/*######
John McGrath via the Google Fusion Tables group authored this script which creates a "sync" between a Google spreadsheet and a Fusion Table.
He has since posted it to GitHub here: https://github.com/jomcgrath2/Fusion-to-Spreadsheet
######*/
var tableID = ' ' // Add the table ID of the fusion table here
var sheetNumber = 1 //Sheet number goes here (the first sheet is number 1 second is number 2 etc.)
Verifying that +mpereira is my blockchain ID. https://onename.com/mpereira
@monkeycycle
monkeycycle / visualizations_tutorial.R
Created November 25, 2015 02:41 — forked from sckott/visualizations_tutorial.R
Tutorial on basic visualizations in R
#######################################################
#### Created by Rolf Lohaus, EEB Dept., Rice University
####
#### Part of the code modified and extended from
#### Robert I. Kabacoff's Quick-R website
#### (http://www.statmethods.net)
#######################################################
############### HIGH-LEVEL PLOTTING FUNCTIONS ###############
@monkeycycle
monkeycycle / README.md
Last active February 8, 2016 00:16
blockbuilder Test
#!/bin/bash
PREFIX=$(basename "$1" .pdf)
if [ ! -z "$TESSERACT_FLAGS" ]; then
echo "Picked up TESSERACT_FLAGS: $TESSERACT_FLAGS"
fi
echo "Prefix is: $PREFIX"
echo "Converting to TIFF..."
if command -v parallel >/dev/null 2>&1; then
LAST_PAGE=$(($(pdfinfo "$1"|grep '^Pages:'|awk '{print $2}') - 1))