Skip to content

Instantly share code, notes, and snippets.

View jerodsanto's full-sized avatar
:shipit:
Always be shipping

Jerod Santo jerodsanto

:shipit:
Always be shipping
View GitHub Profile
#!/usr/bin/env ruby
print 'Enter file size (MB): '
the_size = gets.chomp
unless the_size =~ /^\d+$/
puts "Error: bad file size"
exit
end
desc 'Generate Sitemap'
task :sitemap => :environment do
require 'big_sitemap'
sitemap = BigSitemap.new(:url_options => {:host => 'example.com'})
sitemap.add Ticket
sitemap.generate
# sitemap.ping_search_engines
end
require 'rubygems'
require 'twitter'
auth = Twitter::HTTPAuth.new('username', 'password')
base = Twitter::Base.new(auth)
guilty = base.friend_ids - base.follower_ids
puts "There are #{guilty.size} People you follow who do not follow you"
guilty.each do |user_id|
require 'rubygems'
require 'twitter'
base = Twitter::Base.new(Twitter::HTTPAuth.new('username', 'password'))
my_friends = base.friend_ids
candidates = my_friends.inject(Array.new) { |array,id| array += Twitter.friend_ids(id); array }
candidates -= my_friends
tallied = candidates.inject(Hash.new(0)) { |hash, can| hash[can] += 1; hash }
ordered = tallied.sort { |x,y| y[1] <=> x[1] }
print 'Enter file size (MB): '
the_size = gets.chomp
fail "bad file size" unless the_size =~ /^\d+$/
file_size = 0
string = "abcdefghijklmnopqrstuvwxyz123456"
File.open(the_size + 'MB', 'w') do |f|
while file_size < the_size.to_i * 1048576 # bytes in 1MB
APTGET = "apt-get install -qqy"
RUBY19 = "ruby-1.9.1-p129"
SRC = "/usr/local/src"
WGET = "wget -q"
namespace :ruby do
desc 'download and compile Ruby 1.9'
task :install_19 do
deps = %w'zlib1g-dev libopenssl-ruby1.9'
=dead-center(!height,!width)
:height= !height
:margin-top= -(!height / 2)
:top 50%
:width= !width
:margin-left= -(!width / 2)
:left 50%
:position absolute
:text-align center
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
// Delegation methods
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
Device *device = [[Device alloc] init];
device.token = [devToken description];
require 'test_helper'
class DownloadsTest < ActionController::IntegrationTest
context "An existing donor" do
setup do
@donor = Factory(:donor)
end
should " be able to download a tax receipt" do
require 'date'
class Santo
def is_awesome?
true
end
def birthday_today?
today = Date.today
today.month == bday.month && today.day == bday.day