Skip to content

Instantly share code, notes, and snippets.

View timuruski's full-sized avatar
🥊
Hit. Don't get hit.

Tim Uruski timuruski

🥊
Hit. Don't get hit.
View GitHub Profile
$hort, Too American Pimp (1999) [Too $hort]
Gangsta Rap: The Glockumentary (2007) [Himself]
Get It Where You Fit in 1 (2003) (V) [Himself] <1>
GhettoPhysics: Will the Real Pimps and Hos Please Stand Up? (2010)
Ghostride the Whip (2008) (V) [Himself]
Hip Hop Uncensored Vol. 4: Miami Vice (2002) (V) [Himself]
Menace II Society (1993) [Lew-Loc] <27>
Porndogs: The Adventures of Sadie (2009) (voice) [Bosco] <3>
Rhyme & Reason (1997) [Himself]
Scarface: Greatest Hits on DVD (2003) (V) (as Too Short) [Himself (segment "Sex Faces"]
@timuruski
timuruski / toggle-color-format
Created April 7, 2011 17:04
TextMate command for toggling CSS color format through hex, RGB and RGBA
#!/usr/bin/env ruby
class Color < Struct.new(:r, :g, :b, :a)
def self.from_hex (str)
args = case str.length
when 3; str.scan(/[0-9a-f]/i).map{ |s| "#{s}#{s}".to_i(16) }
when 6; str.scan(/[0-9a-f]{2}/i).map{ |s| s.to_i(16) }
else [0, 0, 0]
end << 1.0
new(*args)
Yesterday, upon the stair,
I met a man who wasn’t there
He wasn’t there again today
I wish, I wish he’d go away...
#include <stdio.h>
int main () {
int i;
for(i = 0; i < 2; i++) { printf("Hello, world!\n"); }
return 0;
}
let(:test_class) do
Class.new do
include MongoMapper::Document
set_collection_name 'proxied_collection_tests'
end
end
let(:test_instance) { test_class.create }
@timuruski
timuruski / git-branch.sh
Created June 6, 2011 21:36
Git branch in prompt
parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/::\1/'
}
export PS1="\u::\W\$(parse_git_branch) \$ "
require 'bundler/setup'
require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new("127.0.0.1", 27017,
:logger => Logger.new(STDOUT))
MongoMapper.database = 'tmp'
class Example
include MongoMapper::Document
@timuruski
timuruski / one_equals_one.rb
Created July 13, 2011 17:35
Horrible test times
# one_equals_one.rb
describe "1 == 1" do
specify { 1.should == 1 }
end
require 'benchmark'
Test = Struct.new(:value)
def contains(a, b)
a.any? do |n|
b.include?(n)
end
end
require 'benchmark'
Test = Struct.new(:value)
def contains(a, b)
a.any? do |n|
b.include?(n)
end
end