Skip to content

Instantly share code, notes, and snippets.

View bakineggs's full-sized avatar

Dan Barry bakineggs

View GitHub Profile
test edit of my gist
require 'cgi'
require 'rubygems'
require 'hpricot'
require 'open-uri'
cgi = CGI.new
print cgi.header('type' => 'text/xml')
doc = Hpricot(open('http://www.apple.com/retail/sanfrancisco/'))
Check out this website http://forgood.yahoo.com
Hack for Good
Any hack or mashup that could better the world and allow more social awareness
Examples:
How green is this website Hack
Custom Searchmonkey module for nonprofits
in validations_i18n_test.rb:
def test_validates_length_of_counts_utf8_characters
Topic.validates_length_of :title, :is => 7
@topic.title = 'El Niño'
@topic.errors.expects(:generate_message).never
@topic.errors.expects(:generate_message).never
@topic.valid?
end
saywatmang: hey lifo why arent transactional migrations supporetd in mysql
defunkt: you cant do ddl in transactions in mysql
abedra: cause mysql is a toy and no one should use it
defunkt: if mysql is a toy, what does that make ruby
lifo: toy box
@bakineggs
bakineggs / hand.rb
Created December 16, 2008 05:46 — forked from imownbey/hand.rb
class Hand
def straight?
values = @cards.map{|card| card.value}.uniq.sort
values.unshift 1 if values.include?(14) # ace can be low
0.upto(values.length - 5) do |i|
return true if values[i] + 4 == values[i + 4]
end
false
end
end
web design inspiration for bakineggs.com:
http://calendaraboutnothing.com/
http://blog.evanweaver.com/
http://cryingwhilecoding.com/
http://www.sixshootermedia.com/ostemplates/clarity/
/*
* main.cpp - part of MP1
*
* Rotates the file in.bmp 180 degrees and saves it to out.bmp
*
*/
#include "EasyBMP.h"
using namespace std;
COMPILER = g++
COMPILER_OPTS = -O0 -Wall -c -g
LINKER = g++
LINKER_OPTS = -o
testscene: testscene.o scene.o image.o EasyBMP.o
$(LINKER) $(LINKER_OPTS) testscene testscene.o scene.o image.o EasyBMP.o
testimage: testimage.o image.o EasyBMP.o