Skip to content

Instantly share code, notes, and snippets.

View monkeycycle's full-sized avatar

Michael Pereira monkeycycle

View GitHub Profile
@monkeycycle
monkeycycle / xls2csv.py
Created May 8, 2017 13:56 — forked from gka/xls2csv.py
Excel to CSV
import xlrd
import csv
import sys
def csv_from_excel(fn):
wb = xlrd.open_workbook(fn)
sh = wb.sheet_by_index(0)
your_csv_file = open(fn.replace('xls', 'csv'), 'wb')
wr = csv.writer(your_csv_file, quoting=csv.QUOTE_ALL)
for rownum in xrange(sh.nrows):
@monkeycycle
monkeycycle / multi-crowbar.js
Created May 8, 2017 13:56 — forked from gka/multi-crowbar.js
like svg-crowbar, but for multiple svg elements!
var multiCrowbar = (function() {
/*
* SVG Export
* converts html labels to svg text nodes
* will produce incorrect results when used with multi-line html texts
*
* Author: Gregor Aisch
* based on https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js
*/
@monkeycycle
monkeycycle / make-animated-gifs-using-ffmpeg.md
Created May 8, 2017 13:56 — forked from gka/make-animated-gifs-using-ffmpeg.md
how to make a nice GIF from png frames

Make sure ffmpeg is up-to-date:

brew update
brew upgrade ffmpeg

Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.

@monkeycycle
monkeycycle / .block
Created April 4, 2017 14:16 — forked from mbostock/.block
Google Maps + D3
license: gpl-3.0
@monkeycycle
monkeycycle / index.html
Created March 31, 2017 03:51 — forked from biovisualize/index.html
Basic Reusable Slopegraph
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src="http://d3js.org/d3.v2.js"></script>
<script type='text/javascript' src="slopegraph.js"></script>
<style type='text/css'>
line.slope-line{
stroke:green
@monkeycycle
monkeycycle / 0_reuse_code.js
Created March 30, 2017 01:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@monkeycycle
monkeycycle / .block
Created March 5, 2017 02:26 — forked from HarryStevens/.block
Annotations with Swoopy Drag for Scatter Plot
license: gpl-3.0
@monkeycycle
monkeycycle / .block
Created March 2, 2017 16:01 — forked from palewire/.block
Load data incrementally in d3 using a sorted value
license: MIT
border: no
height: 800
@monkeycycle
monkeycycle / durhamcounty.py
Created February 24, 2017 04:13 — forked from johnhawkinson/durhamcounty.py
Durham County NYC - Inmate Population Search
#!/usr/bin/python
import mechanize
import lxml.html
BASE_URL = "http://www2.durhamcountync.gov/sheriff/ips/default.aspx"
def parse_names(root):
# finds the names and prints
names = root.xpath("//a[@class='rvsnavy-bold']")
@monkeycycle
monkeycycle / index.js
Created February 24, 2017 04:13 — forked from thomaswilburn/index.js
ASP page scraper with comments
// Built-in modules
var csv = require("csv");
var fs = require("fs");
var url = require("url");
// Loaded from NPM
var $ = require("cheerio"); // jQuery-like DOM library
var async = require("async"); // Easier concurrency utils
var request = require("request"); // Make HTTP requests simply