Skip to content

Instantly share code, notes, and snippets.

View m0wfo's full-sized avatar

Chris Mowforth m0wfo

  • Planet Earth
View GitHub Profile
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
require 'net/telnet'
soundbridge = Net::Telnet.new(
'Host' => '192.168.2.105','Port' => '5555'
)
soundbridge.puts "SetPowerState on yes"
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 = ''
fbsession.activate_with_previous_session(:key => saved_key)
dbcc checkident (tablename, reseed, 0)
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
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
@m0wfo
m0wfo / gist:58415
Created February 4, 2009 23:09
A few examples
# 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"
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
# 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