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 Account | |
def initialize(balance) | |
@balance = balance | |
end | |
def transfer_money(to,amount) | |
p "Sender now has #{balance - amount}" | |
p "Recipient now has #{to.balance + amount}" | |
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
require 'net/telnet' | |
soundbridge = Net::Telnet.new( | |
'Host' => '192.168.2.105','Port' => '5555' | |
) | |
soundbridge.puts "SetPowerState on yes" |
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
require 'rubygems' | |
require 'webrick' | |
require 'webrick/httpservlet/webdavhandler' | |
require 'icalendar' | |
require 'googlecalendar' | |
class WEBrick::HTTPServlet::WebDAVHandler | |
def do_PUT(req,resp) | |
c = File.new(req.path.delete('/$'), 'w+') # Open / create the file iCal has given us {File::RDWR|File::CREAT} | |
previous_file = '' |
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
fbsession.activate_with_previous_session(:key => saved_key) |
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
dbcc checkident (tablename, reseed, 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
chris-mowforths-macbook-pro:~ chris$ share -s 'my stuff' -p 8787 | |
[2009-01-28 21:06:50] INFO WEBrick 1.3.1 | |
[2009-01-28 21:06:50] INFO ruby 1.8.6 (2008-03-03) [universal-darwin9.0] | |
[2009-01-28 21:06:50] INFO WEBrick::HTTPServer#start: pid=2526 port=8787 | |
Registering Service my stuff._http._tcp port 8787 TXT path=/ | |
21:06:51.634 Got a reply for service my stuff._http._tcp.local.: Name now registered and active | |
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
wget http://xruby.googlecode.com/files/xruby-0.3.3a-src.zip | |
unzip xruby-0.3.3a-src.zip | |
chmod +x build.sh; ./!$ | |
java -jar xruby-0.3.3.jar -c sample/test.rb | |
java -jar test.jar |
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
# A few examples | |
open ~/Music/David\ Holmes\ -\ Essential\ Mix\ 98-01/03\ -\ California\ Soul.m4a | |
# Try cloning edge rails and run this in the root folder | |
mdfind —onlyin . "def find" | |
# Really EARN that count injunction | |
“osascript -e ‘set volume 100’” && say "I know where you live" | |
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
wget http://megaui.net/fukuchi/works/qrencode/qrencode-3.0.3.tar.bz2 | |
tar -xjvf qrencode-3.0.3.tar.bz2 && cd qrencode-3.0.3 | |
./configure | |
make | |
sudo make install |
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
# With rQRcode | |
require "rubygems" | |
require "rqrcode" | |
# With rQRcode | |
100.times do |i| | |
RQRCode::QRCode.new("iteration number #{i}", :size => 4, :level => :h) | |
end | |
# With libqrencode |