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
# By Oto Brglez - @otobrglez | |
# Rake task. Put in your (lib/tasks) folder of your Rails application | |
# Execute with "rake dropbox:backup" | |
# Configuration must be inside config/dropbox.yml file | |
namespace :dropbox do | |
desc "Backup production database to dropbox" | |
task :backup 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 n in 1..99 do | |
p n % 7 if n % 3 == 2 and n % 4 == 3 and n % 5 == 4 | |
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
<?php | |
// Grab the IP address | |
// This is the fastest method I've found so far | |
$ip = system('dig +short myip.opendns.com @resolver1.opendns.com'); | |
// For cron logs | |
print "New IP is: " . $ip; | |
$ch = curl_init(); |
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
<% [57, 60, 72, 76, 114, 144, 120, 152].each do |size| %> | |
<link rel="apple-touch-icon" sizes="<%= size %>x<%= size %>" href="<%= image_path("icons/apple-touch-icon-#{size}x#{size}.png") %>"> | |
<% 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
first_string = gets.chomp | |
second_string = gets.chomp | |
to_find = gets.chomp | |
def string_times_int(string, int) | |
product = "" | |
carry = 0 | |
loop = string.length - 1 |