Skip to content

Instantly share code, notes, and snippets.

View wizardishungry's full-sized avatar
🐫
Copyright 1987-2013, Larry Wall

Jon Williams wizardishungry

🐫
Copyright 1987-2013, Larry Wall
View GitHub Profile
<?php
$username = 'xxxxx';
$password = 'xxxxx';
$url = "xxxx/rest/api/2/issue/";
$data = array(
'fields' => array(
<?php
namespace Money;
class Bitcoin {
#const BITCOIN_NODE = '173.224.125.222'; // w001.mo.us temporary
const BITCOIN_NODE = '50.97.137.37';
static private $pending = array();
public static function update() {
@wizardishungry
wizardishungry / tag.rb
Created March 26, 2014 01:24
Ruby glue to commit and tag a bunch of tarballs
#!/usr/bin/env ruby
#usage:
# un-tar mpsh tars to directories and then
# ./tag.rb mpsh-1.0 mpsh-1-1 mpsh-1-2 mpsh-1-2-1 mpsh-1-3 mpsh-1-3-1 mpsh-1-4
dir = "mpsh"
author = "Dave Fischer <dave@cca.org>"
ARGV.each do|a|
a = a.sub /\/$/, ''
if File.directory?(a) then

Download and convert data from NYC open data portal

curl -o nynta.zip "https://nycopendata.socrata.com/api/geospatial/cpf4-rkhq?method=export&format=Shapefile"
cd nynta_12c

ogr2ogr can't deal with the projection directly. Replace content of nynta.prj with the following projection string:

PROJCS["NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["lambert_conformal_conic_2sp"],PARAMETER["False_Easting",984250.0],PARAMETER["False_Northing",0.0],PARAMETER["longitude_of_center",-74.0],PARAMETER["Standard_Parallel_1",40.66666666666666],PARAMETER["Standard_Parallel_2",41.03333333333333],PARAMETER["latitude_of_center",40.16666666666666],UNIT["Foot_US",0.3048006096012192]]

This file has been truncated, but you can view the full file.
étui
études
étude
étagères
étagère
épées
épée
émigrés
émigré
élan
#!/bin/sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
# ls -l --color=always | ansi2html.sh > ls.html
# git show --color | ansi2html.sh > last_change.html
@wizardishungry
wizardishungry / blocked-tweet-sponsors.txt
Created September 18, 2014 20:35
brands i have blocked
blocking ThanksUSA
blocking phunware
blocking NRGDavidCrane
blocking RayTinnenyFit
blocking r17dotcom
blocking Wix
blocking smartling
blocking IntelITCenter
blocking DellBigData
blocking airpair
@wizardishungry
wizardishungry / xmpp_ebooks.rb
Last active August 29, 2015 14:07
facebook / xmpp ebooks
#!/usr/bin/env ruby
require 'xmpp4r'
require 'xmpp4r/client'
require 'xmpp4r/roster'
require 'twitter_ebooks'
include Jabber
class Bot
@wizardishungry
wizardishungry / Case.php
Last active August 29, 2015 14:07
testcase for phpunit process isolation bug
<?php
/**
* @runTestsInSeparateProcesses
*/
class MyCase extends PHPUnit_Framework_TestCase
{
public function testWhatHappensNext()
{
//sleep(10);
<?php
function parseArgs($argv){
array_shift($argv); $o = array();
foreach ($argv as $a){
if (substr($a,0,2) == '--'){ $eq = strpos($a,'=');
if ($eq !== false){ $o[substr($a,2,$eq-2)] = substr($a,$eq+1); }
else { $k = substr($a,2); if (!isset($o[$k])){ $o[$k] = true; } } }
else if (substr($a,0,1) == '-'){
if (substr($a,2,1) == '='){ $o[substr($a,1,1)] = substr($a,3); }
else { foreach (str_split(substr($a,1)) as $k){ if (!isset($o[$k])){ $o[$k] = true; } } } }