Skip to content

Instantly share code, notes, and snippets.

View colindean's full-sized avatar
🏆
Helping others find happiness and serenity

Colin Dean colindean

🏆
Helping others find happiness and serenity
View GitHub Profile
#!/usr/bin/env perl
print "Loading twitter-contest library for ttytter\n";
#####################################################
#####################################################
############## CONFIG SECTION #######################
#####################################################
#####################################################
#space-separated list of terms which must be in the tweet
#Examples:
@colindean
colindean / oo.php
Created September 22, 2010 19:02 — forked from dhotson/oo.php
<?php
// Define the 'class' class
$class = Obj()
->fn('new', function ($class) {
$newClass = Obj($class->methods)
->fn('new', function($class) {
$obj = Obj($class->imethods);
$args = func_get_args();
array_shift($args);
[colin@marle ruby-cucumber]$ cat rakespec.txt
(in /Users/colin/Source/ruby/ruby-cucumber)
** Invoke spec (first_time)
** Execute spec
"-S bundle exec rspec \"./spec/cucumber/ast/background_spec.rb\" \"./spec/cucumber/ast/feature_spec.rb\" \"./spec/cucumber/ast/outline_table_spec.rb\" \"./spec/cucumber/ast/py_string_spec.rb\" \"./spec/cucumber/ast/scenario_outline_spec.rb\" \"./spec/cucumber/ast/scenario_spec.rb\" \"./spec/cucumber/ast/step_spec.rb\" \"./spec/cucumber/ast/table_spec.rb\" \"./spec/cucumber/ast/tree_walker_spec.rb\" \"./spec/cucumber/broadcaster_spec.rb\" \"./spec/cucumber/cli/configuration_spec.rb\" \"./spec/cucumber/cli/drb_client_spec.rb\" \"./spec/cucumber/cli/main_spec.rb\" \"./spec/cucumber/cli/options_spec.rb\" \"./spec/cucumber/cli/profile_loader_spec.rb\" \"./spec/cucumber/core_ext/proc_spec.rb\" \"./spec/cucumber/formatter/ansicolor_spec.rb\" \"./spec/cucumber/formatter/color_io_spec.rb\" \"./spec/cucumber/formatter/duration_spec.rb\" \"./spec/cucumber/formatter/html_spec.rb\" \"./spe
[colin@marle gherkin]$ rake compile --trace
(in /Users/colin/Source/ruby/gherkin)
** Invoke compile (first_time)
** Invoke lib/gherkin/rb_lexer/zh_tw.rb (first_time, not_needed)
** Invoke /Users/colin/Source/ruby/gherkin/tasks/../ragel/i18n/zh_tw.rb.rl (first_time, not_needed)
** Invoke /Users/colin/Source/ruby/gherkin/tasks/../ragel/lexer.rb.rl.erb (first_time, not_needed)
** Invoke /Users/colin/Source/ruby/gherkin/tasks/../ragel/i18n/lexer_common.zh_tw.rl (first_time, not_needed)
** Invoke /Users/colin/Source/ruby/gherkin/tasks/../ragel/lexer_common.rl.erb (first_time, not_needed)
** Invoke ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c (first_time, not_needed)
** Invoke /Users/colin/Source/ruby/gherkin/tasks/../ragel/i18n/zh_tw.c.rl (first_time, not_needed)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -z "$PS1" ]]; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@colindean
colindean / dont.rb
Created April 15, 2011 18:13 — forked from acid/dont.rb
require 'digest/md5'
class Hash
def to_query
require 'uri'
self.collect{ |k,v| k.to_s.downcase + '=' + URI::escape(v)}.join('&')
end
end
caPin = "1234"
caSubDomain = "track"
query = {
@colindean
colindean / gist:1261980
Created October 4, 2011 15:45
test generator failing
# this is failing to work as I thought because #test() is creating a function on the fly.
# is there a way to do this?
[:index, :new].each do |method|
test "should redirect when not logged in (#{method})" do
get method
assert_redirect_to login_url
end
end
@colindean
colindean / cryptor.rb
Created October 21, 2011 15:00
Simple reversible encryption class
#just make sure that you have the appropriate openssl gem required.
#inspiration: http://blog.agoragames.com/blog/2010/05/13/rubyreversibleencryption/
class Cryptor
self.encryption_type = "aes-256-cbc"
def self.encrypt(plaintext, key)
cipher = OpenSSL::Cipher::Cipher.new(self.encryption_type)
cipher.encrypt
cipher.key = key
cipher.iv = iv = cipher.random_iv
@colindean
colindean / zenburn.css
Created October 31, 2011 03:24
Zenburn stylesheet for Quassel IRC client
// This file is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
@colindean
colindean / remote_tournament.rb
Created November 5, 2011 00:24
stack overflowing on method_missing call
=begin
This class exists primarily to act as a bridge between a tournament and its
remote API interface, if one exists.
=end
class RemoteTournament < ActiveRecord::Base
belongs_to :tournament, :polymorphic => true
validates :remote_type, :presence => :true