Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
@rab
rab / image_size.rb
Created April 3, 2009 12:46
ImageSize finds the width x height
# image_size.rb
#
# Copyright (c) 2007 Rob Biedenharn
# Rob [at] AgileConsultingLLC.com
# Rob_Biedenharn [at] alum.mit.edu
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@raws
raws / getTrueName.c
Created August 2, 2010 01:56
Bit of C to resolve the original path of an OS X alias
// getTrueName.c
//
// DESCRIPTION
// Resolve HFS and HFS+ aliased files (and soft links), and return the
// name of the "Original" or actual file. Directories have a "/"
// appended. The error number returned is 255 on error, 0 if the file
// was an alias, or 1 if the argument given was not an alias
//
// BUILD INSTRUCTIONS
// gcc-3.3 -o getTrueName -framework Carbon getTrueName.c
@tokland
tokland / external-command.rb
Created August 18, 2010 18:01 — forked from careo/external-command.rb
Capture stderr data on EventMachine.popen
require 'rubygems'
require 'eventmachine'
$stdout.sync = true
$stderr.sync = true
EM.run {
EM.add_periodic_timer(0.1) {
$stdout.write "stdout\n"
2:02 AM <raws> $ ssh raws@clints-imac
2:02 AM <raws> Clints-iMac raws$ osascript -e "set volume 10"
2:02 AM <raws> Clints-iMac raws$ say -v whisper 'Clint. I am watching you sleeeep'
...
8:30 AM <zap> raws did you make clint's Mac talk all night?
8:30 AM <clint> raws: lol you fuck face
8:30 AM <clint> god damn i thought i was insanew
8:30 AM <clint> i half--woke up when it talked
8:30 AM <clint> but not enough to know whether it was a dream or not
8:30 AM <clint> and then i had dreams telling people about how I thought I had a dream about hearing the mac voice talking to me
@raws
raws / LICENSE
Created December 18, 2011 07:12
Quick Ruby script to convert Minecraft schematics to BOB objects
Copyright (c) 2011 Ross Paffett
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@raws
raws / gist:1495912
Created December 19, 2011 07:35
Shove Bukkit-friendly versions of ModloaderMp and Minecraft Forge into CraftBukkit
# Install ModloaderMp
cd modloadermp
jar uvMf path/to/craftbukkit.jar *
# Install Minecraft Forge
# Note that we do NOT use -M here, as we want to preserve ModloaderMp's MANIFEST.MF
cd minecraftforge
jar uvf path/to/craftbukkit.jar *
# Install BuildCraft
@raws
raws / hector.conf
Created January 4, 2012 03:36
Hector Upstart config
description "Hector IRC server"
env LC_CTYPE=en_US.UTF-8
env RBENV_VERSION=1.9.3-p0
env HECTOR_ROOT=/home/ross/hector/blolol.hect
script
/home/ross/.rbenv/bin/rbenv exec hector daemon
end script
@raws
raws / gist:1580909
Created January 9, 2012 03:41
Minecraft survival server block data

BuildCraft

143.0   Oil

RedPower

Flax

@raws
raws / WeightedCollection.java
Created January 24, 2012 04:24
Weighted randomization in Java
import java.util.NavigableMap;
import java.util.Random;
import java.util.TreeMap;
public class WeightedCollection<E> {
private NavigableMap<Integer, E> map = new TreeMap<Integer, E>();
private Random random;
private int total = 0;
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.