This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# [app name] [old revision] [new revision] | |
# | |
GIT_REPO="/srv/app_data/repository/$1.git" | |
TMP_GIT_CLONE="/tmp/_deploy_$1_clone" | |
PUBLIC_WWW="/srv/app_data/apps/$1" | |
OLD_REVISION=$2 | |
NEW_REVISION=$3 | |
IS_RAILSAPP=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NSGoatString | |
NSGoatString - a "goat" (randomly substituted) string generator. | |
Copyright (C) 2009 James S Urquhart | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example usage | |
class Example | |
{ | |
public static function test() | |
{ | |
var bytes = new JSByteIO(new ArrayBuffer(128)); | |
// Writing and reading a line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple redis client to test pubsub | |
# All clients will send the current time to 'chan' | |
# and print out any messages they receive. | |
require 'rubygems' | |
require 'em-hiredis' | |
EventMachine.run do | |
# Make $rl to listen | |
$rl = EM::Hiredis.connect | |
$rl.on(:message) do |channel, msg| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Basic attempt at reading Tribes 1 .dts files | |
# Appears to be some sort of nested IFF-like block format | |
File.open(ARGV[0]) do |f| | |
pos = 0 | |
while !f.eof | |
f.seek pos | |
magic = f.read(4).unpack("L<")[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# usage: nginx_consolidate.rb /var/log/nginx/*log* | |
# | |
require 'zlib' | |
ARGV.sort.each do |file| | |
if File.extname(file) == ".gz" | |
Zlib::GzipReader.open(file) { |f| STDOUT.write f.read } | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
formail -D 100000000 idcache < $1 -s > $1_new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Counts bits without testing every single bit, using a simple lookup table. | |
# Assumes a maximum size of 32bits. | |
$blookup = (0..255).map do |i| | |
count = 0 | |
(0..7).each { |j| count += 1 if (i>>j) & 0x1 != 0 } | |
count | |
end | |
# Count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Converts tiddlywki tiddlers into files which can be imported into Notational Velocity | |
require 'fileutils' | |
require 'rexml/document' | |
require 'time' | |
require 'date' | |
tiddlywiki_location = ARGV[0] | |
if tiddlywiki_location.nil? | |
puts "Please specify the location of your Tiddliwki" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Author: Matthias Hoechsmann, gamedrs.com | |
# Ported to Ruby by James Urquhart, github.com/jamesu | |
# Artefact Removal using Edge Copy by Patrick Wolowicz, subzero.eu | |
# This source code an be used freely and is provided "AS IS" without any warranties. | |
# Go and visit www.zombiesmash.gamedrs.com. Thank you :) | |
# README | |
# mkatlas.rb is a ruby script for generating an atlas image from individual images and a C header file with image coordinates. |