Skip to content

Instantly share code, notes, and snippets.

View jsvine's full-sized avatar

Jeremy Singer-Vine jsvine

View GitHub Profile
cd ~/
# Add QGIS repo
sudo add-apt-repository -s "deb http://qgis.org/debian trusty main"
# Add TileMill repo
sudo add-apt-repository ppa:developmentseed/mapbox
# Update/upgrade
sudo apt-get update && sudo apt-get upgrade
@onyxfish
onyxfish / electris.yml
Created September 27, 2012 14:16
Teamocil Config
session:
name: "electris"
windows:
- name: "term"
clear: true
root: "~/src/electris"
filters:
before:
- "workon electris"
splits:
require 'rubygems'
require 'simpler_tiles'
breaks = [0.05, 0.15, 0.30, 0.45, 0.60]
cbreaks = [0.40, 0.50, 0.60, 0.70, 0.80]
colors = [[236, 231, 242], [166, 189, 219], [116, 169, 207], [54, 144, 192], [5, 112, 176], [3, 78, 123]]
def color(color)
sprintf("#%2x%2x%2x", *color).gsub(" ", "0")
end
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Git
alias gs="git status"
alias ga="git add"
alias go="git checkout"
alias gc="git commit"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gp="git push"
@thejefflarson
thejefflarson / advanced.rb
Last active December 12, 2015 01:39
These two examples are what I mean when I say learn to program. The first is the upper limits of knowledge, and the second is pretty much all an average journalist needs to know. If you can read the second you probably have all the knowledge a journalist needs. The bottom would take about a sum total of a week of study to learn. The top one take…
require 'thread'
require 'csv'
require 'net/http'
require 'json'
id = 0
max_id = 30
class Atomic
def initialize(val)
@jonkeegan
jonkeegan / iPhoto Faces
Created March 5, 2013 16:25
Here's a nice little one liner for your Mac that will create a giant mosaic image of all the faces iPhoto has found in your photos taken in 2013. Requires imagemagick, and assumes your iPhoto Library is in it's regular spot. This is for the latest version of iPhoto '11. The faces are ALL of the faces iPhoto can find, even if they haven't ben nam…
montage null: ~/Pictures/iPhoto\ Library/Thumbnails/2013*/*/*/*/IMG_*_face*.jpg null: -gravity center ~/Desktop/2013_faces.png
@veltman
veltman / gist:6186441
Last active December 20, 2015 19:49
Bookmarklet, when executed on a google search results page it will cycle through everything in search_terms[] and record the suggestions to a big JSON object. After it cycles through all the terms, it will replace the document HTML with the stringified JSON. Minify it before using it.
(function(){
//get jQuery
if (window.jQuery === undefined) {
var done = false;
var script = document.createElement("script");
script.src = "http:////ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js";
script.onload = script.onreadystatechange = function(){
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) {
done = true;
@vaguity
vaguity / Hacks-Hackers NYC: Encryption and Operational Security for Journalists (2013-09-16).md
Last active April 29, 2016 17:34
Notes from Hacks/Hackers NYC workshop on encryption and opsec for journalists. Notes come from talk by Jennifer Valentino.

Hacks/Hackers NYC: Encryption and Operational Security for Journalists (2013-09-16)

Jennifer Valentino, Wall Street Journal (@jenvalentino)

These notes come straight from Jennifer's presentation; slides at https://docs.google.com/file/d/0B2HGtAJEbG8PdzVPdHcwekI2V2M/edit

Background

  • NSA covers 75% of internet traffic; not all is collected or sifted
  • Big issues with suveillance are not the NSA but leak investigations, subpoenas, accidental disclosure and chilling effects on sources
@pippinlee
pippinlee / bv-books.md
Created September 12, 2013 03:53
Some of these can't be found on Amazon anymore and must be found the fun way, hunting through your local book shop.
@veltman
veltman / README.md
Created October 10, 2016 16:08
Geosupport w/ JS and node-ffi

Geocoding 10,000 addresses a second with NYC's Geosupport library and Node FFI

Following on Chris Whong's excellent writeup of how to make calls directly to NYC's Geosupport client and this first attempt at generalizing it, here's a way that let me geocode about 10,000 addresses a second on Ubuntu using Node FFI.

Note: this assumes Ubuntu - other Linux is probably fine but may need adjustments.

First, install the basics:

# Update, install Node and unzip (if needed)