Skip to content

Instantly share code, notes, and snippets.

View bryanwoods's full-sized avatar
💭
Replacing Security Deposits

Bryan Woods bryanwoods

💭
Replacing Security Deposits
View GitHub Profile
@bryanwoods
bryanwoods / HelloGoodbye.j
Created September 4, 2008 19:09
Hello/Goodbye in Cappuccino
import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPTextField label;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
#ALL HAILZ THE TRV DVRK EMPORER
#THEBIRDCAGETHEATER
require 'ruby-processing'
require 'boids'
class HailHail < Processing::App
attr_reader :blackout
# And what shall He look like?
#IRB Funone
def hacked_computer
(1000 * 100).times do
puts "Preparing hard drive for reformat"
end
end
def ruin_computer
(1000 * 100).times do
for i in 1..100;if i%15==0;print"FizzBuzz";elsif i%5==0;print"Buzz";elsif i%3==0;print"Fizz";else;print i;end;print "\n";end
## Don't be fooled by the code that I block ##
# Don't be fooled by
def fooled
result = "Don't be fooled by \n"
return result
end
# The rocks that I've got
if (document.images) {
var button1_up = new Image();
button1_up.src = "collapse.gif";
var button1_down = new Image();
button1_down.src = "expand.gif";
}
function switchButton1() {
if (document["button1"].src == button1_down.src) {
document["button1"].src = button1_up.src
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
start = (1..999).to_a
# x = [ 3, 6, 9, 12, 15, 18 ]
# y = [ 5, 10, 15, 20 ]
# All multiples of 3 and then all multiples of 5 in seperate lists ,add sum
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
def list_of_mults(from, multiple)
from.select {|i| i % multiple == 0 }
end
def check_result(res, multiple)
zeroes = res.collect {|i| i % multiple}
bad_ones = zeroes.select {|i| i != 0}
from pysqlite2 import dbapi2 as sqlite
import urllib2
from BeautifulSoup import *
from urlparse import urljoin
# Create a list of words to ignore
ignorewords=set(['the','of','to','and','a','in','is','it'])
class crawler:
# Initialize the crawler with the name of database
class PeanutButter
def self.jam
charcount = 'this is a tweet'.count('a-z- ')
end
def self.jelly
if jam == 140
print "Hell yeah! 140 characters! \n"
elsif jam != 140