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
var dsTweets = new Ext.data.JsonStore({ | |
fields : [{name: 'text', type: 'string'}], | |
proxy : new Ext.data.ScriptTagProxy({ | |
url : 'http://twitter.com/status/user_timeline/buccolo.json?count=10' | |
}) | |
}); | |
dsTweets.load({ callback: function(){ | |
var tweets = store.query(''); |
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
#!/usr/bin/ruby | |
p = 1373 | |
B = 805 | |
i = 1 | |
brute = 1 | |
target = 397 | |
while (brute != target) | |
brute = B ** i % p |
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
#!/usr/bin/ruby | |
class String; def ord; self[0]; end; end | |
phrase = "tobeornottobethatisthequestion" | |
keyword = "hamlet" | |
len = keyword.length | |
keyindex = 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
#!/usr/bin/ruby | |
if ARGV.length != 2 | |
print "syntax: ./Ord prime number\n" | |
exit | |
end | |
number = ARGV[1].to_f | |
number_print = ARGV[1].to_f | |
prime = ARGV[0].to_f |
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
#!/usr/bin/ruby | |
require 'rational' | |
number = ARGV[0].to_i | |
current = 0 | |
phi = 0 | |
while (current < number) | |
if (number.gcd(current) == 1) |
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 FixBorders | |
def go_horse! | |
all_images = load_image_list | |
all_images.each do |image| | |
# download original | |
# convert different sizes | |
# upload to S3 | |
end | |
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
# cat pwd.txt | cut -d : -f 2 | sort | uniq -c | sort -f -r | |
freq password | |
1270 315475 | |
487 123456 | |
176 123456789 | |
68 102030 | |
59 123 | |
50 12345 | |
44 1234 |
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu-precise64-chef" | |
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.4.4.box" | |
config.vm.network :private_network, ip: "10.0.0.10" | |
config.vm.hostname = "detroit" | |
config.vm.provision :chef_solo do |chef| |
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
# Executes nginx recipe. | |
include_recipe "detroit::nginx" | |
# Creates deploy directory with correct permissions. | |
directory "/data/www" do | |
owner "nginx" | |
group "nginx" | |
mode "755" | |
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
worker_processes 3; | |
http { | |
server { | |
listen 80; | |
location / { | |
root /data/www; | |
} | |
} |
OlderNewer