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
@saranrapjs
saranrapjs / varnish_test_cached.js
Last active August 29, 2015 13:57
PhantomJS script for deducing included resources using headless webkit, and determining which of them have been successfully cached by Varnish!
var system = require('system'),
fs = require("fs"),
CACHED_HEADER_NAME_REGEX = /X-Cache/,
CACHED_HEADER_VALUE_REGEX = /HIT/,
address,
parsedAddress,
cachedBytes = 0,
nocacheBytes= 0,
showAllURLS = false,
quiet = false,
@jart
jart / mtgox.php
Created March 12, 2014 16:05
Some Mt.Gox Source Code
<?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() {
@curtislacy
curtislacy / gist:8424181
Last active July 31, 2018 22:51
Bitcoin setup
# Create a new Ubuntu 13 instance.
# Get the tools and things as specified in https://gist.github.com/curtislacy/3905950/
sudo fdisk -l
sudo mkfs -t ext3 /dev/xvde1
sudo mkdir /var/lib/blockchain
sudo vi /etc/fstab
# Add:
# /dev/xvde1 /var/lib/blockchain ext3 defaults,noatime 0 2
sudo mount -a
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@nicky-zs
nicky-zs / memcpy.c
Created November 19, 2013 06:31
One way to solve the glibc compatibility problem. In my case, when building a program with libthrift.a on linux with glibc version 2.15, ld always links memcpy@GLIBC_2.14 which cannot be found on systems with glibc version < 2.14. So, use this file to define a symbol __wrap_memcpy and use -Wl,--wrap=memcpy to tell ld using this symbol when meeti…
#include <string.h>
void *__memcpy_glibc_2_2_5(void *, const void *, size_t);
asm(".symver __memcpy_glibc_2_2_5, memcpy@GLIBC_2.2.5");
void *__wrap_memcpy(void *dest, const void *src, size_t n)
{
return __memcpy_glibc_2_2_5(dest, src, n);
}
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mlc
mlc / gist:5625204
Created May 22, 2013 04:15
reading my new citibike key
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<InfoDump application="NFC TagInfo" version="1.09c">
<Tag rfTechnology="Type V (ISO/IEC 15693 / Vicinity)">
<GeneralInformation>
<Value name="uid" description="UID">e0XXXXXXXXXXXXXX</Value>
<Value name="rfTechnology" description="RF technology">Type V (ISO/IEC 15693 / Vicinity)</Value>
<Value name="tagType" description="Tag type">SL2 ICS2001 (ICODE SLI)</Value>
<Value name="manufacturer" description="Manufacturer">NXP Semiconductors (Germany)</Value>
<Value name="afiString" description="Application family identifier (AFI)">all families and sub-families</Value>
<Value name="afi" description="AFI (numeric)">00</Value>
@jcs
jcs / gist:5573685
Last active April 2, 2024 20:18
macOS FileVault encryption and OpenBSD encrypted softraid on a Macbook Air/Pro

Update (2019-05-06): The Broadcom wireless card in the MacBook Pro works and can be crammed into the Air.

Update (2015-12-04): This document used to be very lengthy as there were many manual steps required to get OpenBSD and Mac OS X working together through Boot Camp Assistant (BCA), which created a hybrid MBR and enabled a legacy BIOS emulation mode which older versions of Windows (and OpenBSD) required. Newer Macbooks stopped supporting older versions of Windows through BCA and now only support Windows 10 since it uses GPT and UEFI. However, now that newer versions of OpenBSD support GPT and UEFI, Boot Camp Assistant is no longer needed at all to boot OpenBSD.

macOS FileVault encryption and OpenBSD encrypted softraid on a Macbook Air/Pro

OpenBSD works pretty well on at least the Mid-2011 Macbook Air (A1370, SandyBridge) and Mid-2013 Macbook Air (Haswell). The new KMS code in 5.4 brings up the MBA's eDP display in 1366x768 with backlight

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]]

@yanofsky
yanofsky / LICENSE
Last active May 4, 2024 08:45
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit