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
#!/usr/bin/ruby | |
# | |
# tvrss - a BitTorrent torrent-RSS puller | |
# | |
# Make a directory called ~/.tvrss | |
# Make another called ~/.tvrss/torrents | |
# Put URLs of RSS feeds in ~/.tvrss/feeds | |
# Bob's your uncle! | |
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
class AnagramDict | |
begin | |
@@anagramdict = Marshal.load "anagramdict.marshal" | |
rescue | |
@@anagramdict ||= Hash.new | |
File.read("/usr/share/dict/word.list").split(/\n/).each do |word| | |
sortedword=word.split('').sort.join | |
@@anagramdict[sortedword] ||= [] | |
@@anagramdict[sortedword] << word | |
end |
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
# A nice demonstration of how much faster Ruby 1.9 is than Ruby 1.8 | |
require "complex" | |
class Complex | |
def m | |
z=self | |
1024.times { |i| z=z*z+self; return i+1 if z.abs > 2 } | |
return 1024 | |
end |
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
require "complex"; class Complex; def m; z=self; 1024.times {|i|z=z*z+self; | |
return i+1 if z.abs>2};return 1024 end end;(1.0).step(-1,-0.05) do |y| | |
(-2.0).step(0.5,0.0315) do |x| print " .,:;~=/$@#"[(Math.log(Complex(x,y).m)/ | |
Math.log(2)).to_i].chr end; puts end |
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
Filesystem Type Size Used Avail Use% Mounted on | |
/dev/mapper/shibuyagi-root | |
ext4 40G 13G 26G 33% / | |
/dev/mapper/shibuyagi-boot | |
ext4 97M 86M 6.3M 94% /boot | |
/dev/mapper/shibuyagi-dagbrown | |
ext4 99G 28G 66G 30% /home/dagbrown | |
tmpfs tmpfs 4.0M 0 4.0M 0% /var/lock | |
tmpfs tmpfs 4.0M 64K 4.0M 2% /var/run | |
tmpfs tmpfs 3.0G 0 3.0G 0% /dev/shm |
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
# robots.txt for http://www.whitehouse.gov/ | |
User-agent: * | |
Disallow: /cgi-bin | |
Disallow: /search | |
Disallow: /query.html | |
Disallow: /help | |
Disallow: /360pics/iraq | |
Disallow: /360pics/text | |
Disallow: /911/911day/iraq |
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
#!/usr/bin/zsh | |
DELETE_WAV=true | |
while true | |
do | |
case "$1" in | |
-r) | |
shift; | |
RATE=$1 |
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
def setquit(): | |
"""Define new builtins 'quit' and 'exit'. | |
These are objects which make the interpreter exit when called. | |
The repr of each object contains a hint at how it works. | |
""" | |
if os.sep == ':': | |
eof = 'Cmd-Q' | |
elif os.sep == '\\': |
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
def setquit(): | |
"""Define new builtins 'quit' and 'exit'. | |
These are objects which make the interpreter exit when called. | |
The repr of each object contains a hint at how it works. | |
""" | |
if os.sep == ':': | |
eof = 'Cmd-Q' | |
elif os.sep == '\\': |
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
Python 2.7.5 (default, Nov 6 2013, 17:10:18) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> a = 5 | |
>>> a > 3 | |
True | |
>>> a < 3 | |
False | |
>>> True = 42 | |
>>> True * 2 |
OlderNewer