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
@wizardishungry
wizardishungry / stellar-database-tiny.json
Created October 17, 2012 05:20
Example Stellar Database JSON
{
"Sol": {
"name": "Sol",
"proper_names": ["Sol", "Helios", "The Sun"],
"age": "4800 million years",
"standard_error_in_age": "0%",
"heavy_element_abundance": "100% of Sol",
"standard_error_in_heavy_element_abundance": "0%",
"arity": "singular",
"points_of_interest": "The \"8\" in the Detected Planets entry is not an error. Pluto is not a \"planet,\" but a huge, close-orbiting, low-eccentricity Kuiper Belt object. With a big moon. Of course, some die-hards out there still insist that it really is a planet, more for sentimental reasons than anything else. They're welcome to live in their little fantasy world. Neener neener.",
curl https://api.github.com/users/WIZARDISHUNGRY/starred #ugh json
if [ -f /opt/local/etc/bash_completion ] && ! shopt -oq posix; then
. /opt/local/etc/bash_completion
fi
# only use __git_ps1 if the function is defined
type __git_ps1 2> /dev/null > /dev/null
if [ $? -eq 0 ]; then
export PS1='\! \h:\w$(__git_ps1)\$ '
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWSTASHSTATE=1
@wizardishungry
wizardishungry / run s3sync without batching.sh
Created August 6, 2012 16:17
TACO BELL PROGRAMMING MENU
cd /mnt/whatever &&
find * -type f -print0 | xargs -0 -n 1 -P 5 -I % s3cmd sync --skip-existing % s3://bucketwhatever/%
@wizardishungry
wizardishungry / adam.php
Created July 24, 2012 16:01
Test my assumptions about how self:: works / late static binding
<?php
/*
http://php.net/manual/en/language.oop5.late-static-bindings.php
*/
class Adam {
const LORD='Adonai';
public $knowledge = self::LORD;
public function getLord() { return self::LORD; }
Babylon Zoo - Spaceman (Arthur Meets The Spaceman)
Filter - Take A Picture
Dishwalla
Hum
(nin, janes addiction)
#!/bin/bash
for i
do
lynx -dump "http://www.google.com/search?q=$i&hl=en&client=safari&rls=en&tbs=isz:ex,iszw:32,iszh:32&tbm=isch&source=lnt&sa=X&ei=9eL1T9vXJsLx0gHKx6HyBg&ved=0CC0QpwUoAQ&biw=1482&bih=886" | grep imgurl=| sed 's/.*imgurl=//' | sed 's/\&.*//' | grep '\....$' | grep -v ico | grep -v ebay
done
@wizardishungry
wizardishungry / knife.rb
Created June 28, 2012 02:40
My knife.rb for quickly switching between work and home configs
require "chef/knife"
CHEF_ENV = ENV['CHEF_ENV'] || "get-a-life"
log_level :debug
log_location STDOUT
eval File.read "#{File.dirname File.expand_path(__FILE__)}/knife-#{CHEF_ENV}.rb"
@wizardishungry
wizardishungry / annoying.php
Created June 27, 2012 19:12
explanation of how list() doesn't work with key based arrays in php
<?php
$picture = new Imagick($path);
print_r($picture->getImageGeometry());
list($width, $height) = $picture->getImageGeometry(); // doesn't work
list($width, $height) = array_values($picture->getImageGeometry()); // works
@wizardishungry
wizardishungry / Gemfile
Last active February 12, 2018 18:49
Vagrant snippet to set VirtualBox guest CPU count to the number of host cores on Linux or OS X (broken 2018)
gem 'concurrent'