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
@raws
raws / downcase.sh
Created July 15, 2012 17:12
Bash helper script for recursively lowercasing file names
#!/bin/bash
#
# downcase PATH
#
# Recursively convert all file names contained in the given directory
# tree (but excluding the given directory itself) to lowercase.
# Existing files which are named identical to new, lowercased file
# names will be clobbered.
#
# Author: Ross Paffett <ross@rosspaffett.com>
@raws
raws / create-git-repo.sh
Created July 15, 2012 06:17
Bash helper script for creating a Git repository on systems hosting them
#!/bin/bash
#
# create-git-repo
#
# Create and publish a Git repository so that it is able to be
# cloned via `git clone git@host:repo.git'.
#
# Author: Ross Paffett <ross@rosspaffett.com>
GIT_DATA="/var/git" # Where to store the actual git repositories
@sj26
sj26 / 0-readme.md
Created May 5, 2012 05:39 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

scope :module => "Api::V2" do
scope :path => "api/v2" do
resources :users
end
end
scope :module => "Api::V1" do
scope :path => "api/v1" do
resources :users
end
@raws
raws / gist:1861817
Created February 19, 2012 03:32
Spoutcraft development Rake tasks
# Spoutcraft development Rake tasks
# Usage: rake -T
#
# These tasks assume the following folder structure:
# spoutcraft/
# lib/
# spoutcraft-api.jar A compatible SpoutcraftAPI package
# mcp/ Minecraft Coder Pack
# conf/ Symlink to ../conf
# lib/ Symlink to ../lib
@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.

@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;
@raws
raws / gist:1580909
Created January 9, 2012 03:41
Minecraft survival server block data

BuildCraft

143.0   Oil

RedPower

Flax

@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: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