This file contains 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
import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
CPTextField label; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ |
This file contains 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
#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? |
This file contains 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
#IRB Funone | |
def hacked_computer | |
(1000 * 100).times do | |
puts "Preparing hard drive for reformat" | |
end | |
end | |
def ruin_computer | |
(1000 * 100).times do |
This file contains 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
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 |
This file contains 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
## 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 |
This file contains 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
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 |
This file contains 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
# 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 |
This file contains 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
# 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} |
This file contains 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 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 |
This file contains 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 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 |
OlderNewer