This file contains hidden or 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
#!/bin/sh | |
user="mysqluser" | |
pass="mysqlpass" | |
dir="/tmp/backup" | |
for i in /var/lib/mysql/*/; do | |
dbname=`basename $i` | |
if [ $dbname != "mysql" ]; then | |
mysqldump -u$user -p$pass $dbname > $dir/db/$dbname.sql |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VVTlNSR0KAAhAB | |
TxARMCAwIDAgMC44OTk5OTk5OADSEBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29s | |
b3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRFxhUcm9vdIABCBEaIy0yNztB |
This file contains hidden or 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
ssh_user = "[email protected]" # for rsync deployment | |
remote_root = "~/path/to/remote/" # for rsync deployment | |
namespace :styles do | |
desc "Clear styles" | |
task :clear do | |
puts "*** Clearing styles ***" | |
system "rm -Rfv css/*" | |
end | |
desc "Generate styles" |
This file contains hidden or 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
# Gets race and quali info from f1.com and returns an array table with Position, Driver, Team, Time/Retired, Laps | |
# | |
# Eg | |
# [ | |
# ["1", "Jenson Button", "McLaren-Mercedes", "1:34:09.565", "58"], | |
# ["2", "Sebastian Vettel", "Red Bull Racing-Renault", "+2.1 secs", "58"], | |
# ["3", "Lewis Hamilton", "McLaren-Mercedes", "+4.0 secs", "58"], | |
# ... | |
require 'rubygems' |
This file contains hidden or 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
# Check Skype status. You need to enable 'Show my status on the web' in Skype prefs | |
# | |
# skype = SkypeStatus.new('some.username') | |
# skype.online? | |
# => true | |
require 'net/http' | |
require 'uri' | |
class SkypeStatus |
This file contains hidden or 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
# <%= google_analytics 'UA-XXXXXX-XX' %> | |
# </body> | |
# application_helper.rb | |
module ApplicationHelper | |
def google_analytics(id) | |
content_tag :script, :type => 'text/javascript' do | |
"var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', '#{id}']); |
This file contains hidden or 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
status = "Text message you don't want from Telstra when you're overseas: YOU HAVE USED 60MB ON INTERNATIONAL ROAMING AT A COST OF UP TO $15.00 PER MB... Oooops :(" | |
status.length.to_f / 1024 / 1024 * 15 * 100 | |
=> 0.217437744140625 |
This file contains hidden or 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
<form accept-charset="UTF-8" action="/suppliers/6/products/38" class="edit_product" data-remote="true" id="edit_product_38" method="post" name="edit_product_38"> | |
<div style="margin:0;padding:0;display:inline"> | |
<input name="utf8" type="hidden" value="✓"><input name="_method" type="hidden" value="put"><input name="authenticity_token" type="hidden" value="K5dKVuoTllzbCT5uJkWuHAoUsayE4Z5irFjXcuP2dME="> | |
</div> | |
<p><label for="product_name">Name</label> <input id="product_name" name="product[name]" size="30" type="text" value="Bacon Streaky Precooked"></p> | |
<p><label for="product_item_number">Item number</label> <input id="product_item_number" name="product[item_number]" size="30" type="text" value="40656"></p> | |
<p><label for="product_carton_quantity">Carton quantity</label> <input id="product_carton_quantity" name="product[carton_quantity]" size="30" type="text" value="4x1kg"></p> | |
<p><label for="product_uom">UOM</label> <input id="product_uom" name="product[uom]" si |
This file contains hidden or 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
time = Time.now + 60 | |
queue_command = <<-CMD | |
at -t #{time.strftime('%Y%m%d%H%M')} <<-AT | |
echo "ran at #{time}" > output.txt | |
CMD | |
system queue_command |
This file contains hidden or 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
# Homebrew Formula for PHP 5.2.17 as php-cgi (for nginx, etc.) | |
require 'formula' | |
class PhpCgi <Formula | |
@url='http://www.php.net/get/php-5.2.17.tar.bz2/from/a/mirror' | |
@version='5.2.17' | |
@homepage='http://php.net/' | |
@md5='575551f5df56b9311e932b3a098c2e7a' |
OlderNewer