Skip to content

Instantly share code, notes, and snippets.

View tomato.rb
Butts.send :butt=>'fart'
100.times {puts <<EOF
___ ___ ___ ___ ___ ___ ___
/ / / / | / / / / / / / / / /
/__/ /__/ |/ / /__ /__/ / / / /__ /__
/ | / \ / / / / \ / / / / /
/__/ / \ / /___ /___ / \ /__/ /__ /___ ___/
EOF
}
puts <<EOF
View gist:45
require 'spec_helper'
describe GroupsController do
include SessionTestHelper
describe "GET 'show'" do
it "should load the group from the database" do
@the_group = Factory(:group)
Group.stub(:find_active_by_unique_name).with("london-developers").
and_return(@the_group)
View gist:46
require 'spec_helper'
describe GroupsController do
include SessionTestHelper
describe "GET 'show'" do
it "should load the group from the database" do
@the_group = Factory(:group)
Group.stub(:find_active_by_unique_name).with("london-developers").
and_return(@the_group)
View cacheslam.c
#include <stdlib.h>
#define BLOCKS 8192
#define BLOCKSIZE 8192
int main() {
int* blocks[BLOCKS];
int i;
for (i=0;i<BLOCKS;i++) {
blocks[i] = (int*)calloc(BLOCKSIZE,sizeof(int));
View gist:1800
bryce@bryce-imac ~> cat /mach_kernel | openssl sha1
60b55b9c3daca7018db613e22563b2177906729b
bryce@bryce-imac ~> openssl sha1 /mach_kernel
SHA1(/mach_kernel)= 60b55b9c3daca7018db613e22563b2177906729b
View aes_test.rb
require 'openssl'
class String
def to_bin
[self].pack('H*')
end
def to_hex
unpack('H*').first
end
end
vectors = [
View gist:2997
#python or ruby - turns out it doesn't matter
inc = random(0,2*pi)
az = random(0,2*pi)
dist = random(5,80)
cx = dist * cos(az)
cy = dist * sin(az)
sh = (cy/80)*0.6
x = 350 + (250+cx)*cos(inc)
y = 350 + (250+cx)*sin(inc)
z = cy
View gist:3520
(in /Users/bryce/Documents/hive/vendor/grit)
Loaded suite -e
Started
.............
..............................................................................................................FFE...........
Finished in 1.550918 seconds.
1) Failure:
test_basic(TestRubyGitAlt)
[./test/test_rubygit_alt.rb:18:in `test_basic'
View alpha.txt
* When an object is corrupt in a pack, the object became unusable even
when the same object is available in a loose form, We now try harder to
fall back to these redundant objects when able. In particular, "git
repack -a -f" can be used to fix such a corruption as long as necessary
objects are available.