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
require 'rubygems' | |
require 'activesupport' | |
class Foo | |
# Mimic Magic | |
cattr_accessor :bar | |
class << self | |
def set_bar(value) | |
@@bar = value | |
end |
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
class EPlayer < Player | |
def initialize( opponent_class_name ) | |
@oc = Module.const_get opponent_class_name | |
hack_game | |
end | |
def choose | |
sabotage find_opponent | |
hack_game | |
:paper |
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
Real world savings for people that run real webservers is equal | |
to 8 kilobytes. Get real, get pragmatic and stop byte fucking! | |
| orig | YUI'ed | |
---------------------------------- | |
prototype.js | 129.7 | 74.9 | |
(gzipped) | 29.9 | 21.9 | |
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
require 'fileutils' | |
source_path = "/Users/kencollins/Desktop/source.txt" | |
move_path = "/Users/kencollins/Desktop/move.txt" | |
FileUtils.rm move_path if File.exists?(move_path) | |
File.open(source_path,'w') { |f| 30000.times{f.write("#{'x'*70}\n")} } | |
FileUtils.move source_path, move_path |
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
# ISSUE: http://github.com/thoughtbot/paperclip/issues/#issue/118 | |
has_attached_file :file, :processors => [:noop] | |
module Paperclip | |
class Noop < Processor | |
def make | |
file |
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
From d6e50913039d93d5a55daf3e952c79c839f9cdca Mon Sep 17 00:00:00 2001 | |
From: Ken Collins <[email protected]> | |
Date: Mon, 23 Nov 2009 11:44:23 -0500 | |
Subject: [PATCH] Allow :processors => false option to no op any processor actions. | |
--- | |
lib/paperclip/attachment.rb | 2 +- | |
test/attachment_test.rb | 19 +++++++++++++++++++ | |
2 files changed, 20 insertions(+), 1 deletions(-) |
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
myrsync_src="/Users/kencollins/Work Shed" | |
myrsync_dest="/Volumes/backup/Exchange/Work Shed" | |
function mount_backup () { | |
if [[ ! -d /Volumes/backup ]]; then | |
mkdir /Volumes/backup | |
mount_afp afp://user:[email protected]/backup /Volumes/backup | |
fi | |
} |
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
function gsrb () { | |
branch=$(git-branch-name) | |
git checkout master | |
git svn rebase | |
git checkout "${branch}" | |
git rebase master | |
} | |
function gsu () { | |
git checkout master |
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
NSSet *touches = (NSSet *)[touchesAndEvent objectForKey:@"touches"]; |
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
class User | |
def self.space | |
'Top' | |
end | |
end | |
module MyNamespace | |
class User | |
def self.space |