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
| // | |
| // Generate DTMF tones | |
| // | |
| #include <stdio.h> | |
| #include <math.h> | |
| float OutData[44100]; | |
| typedef struct ToneInfo { |
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
| # Script to automate reserving tickets from amiando. | |
| # Polls the site using chromedriver, automatically selecting 1 ticket | |
| # and moving to the next step. | |
| # | |
| # Please use responsibly. | |
| # | |
| require 'rubygems' | |
| require "selenium/webdriver" |
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 |