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
#!/usr/bin/ruby -w | |
require 'fileutils' | |
$pageBreakTag = /<hr>\s<A name=[0-9]+><\/a>/i | |
$brTag = /<br>/i | |
$bodyTag = /<body[^>]*>/i | |
$fileHeaderTag = /file.*<br>/i | |
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
def season(dn) | |
Dir.glob(dn+"/*").sort.each do |fn| | |
if fn=~/#{dn}\/.*?(\d+)x\d+.*?/ | |
sdir = dn+"/#{dn} Season #{$1}" | |
FileUtils.mkdir_p(sdir) | |
FileUtils.mv(fn, sdir+"/") | |
end | |
end | |
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
#!/bin/sh -x | |
CURRENT=`git branch | grep "\*" | cut -d' ' -f2` | |
git checkout master | |
git svn info >/dev/null 2>/dev/null | |
if [[ $? == 0 ]]; then | |
git svn rebase | |
else | |
git pull origin master | |
fi | |
git checkout ${CURRENT} |
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
To use this: | |
1. check out the gist somewhere | |
2. edit the plist to contain the path to the .rb file | |
3. run this: | |
chmod +x update-webkit.rb | |
launchctl load com.indirect.update-webkit.plist |
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
# TV show renamer/sorter script | |
# Call with directories to sort from and to: | |
# autosorter.rb 'Downloads/Completed' 'Video/TV Shows' | |
NAME_FORMATS = [ | |
/^(.+?) S(\d\d)E(\d\d(?:-E\d\d)?)(.*?)(?: (?:\wDTV|PROPER|WS).*)? (...)$/i, # S00E00 format | |
/^(.+?) (\d?\d)x(\d\d(?:-\d\d)?)(.*?)(?: (?:\wDTV|PROPER|WS).*)? (...)$/i # 00x00 format | |
] | |
class String |
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
fatal: Invalid revision range 0000000000000000000000000000000000000000..26890b460a9ef76cdcdc6fd75e597d3e5fe3a508 | |
/var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:171:in `[]': stack level too deep (SystemStackError) | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:171:in `find_object_in_index' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:159:in `find_object' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:64:in `with_idx' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:158:in `find_object' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/internal/pack.rb:125:in `[]' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/repository.rb:75:in `get_raw_object_by_sha1' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/repository.rb:74:in `each' | |
from /var/lib/gems/1.8/gems/grit-0.9.1/lib/grit/git-ruby/re |
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
#!/usr/bin/env ruby | |
# Movie date search by filename | |
require 'rubygems' | |
require 'open-uri' | |
require 'cgi' | |
require 'hpricot' | |
files = Dir[File.join(ARGV[0], '*')] | |
unless files.any? |
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
#!/usr/bin/ruby -w | |
require 'fileutils' | |
$pageBreakTag = /<hr>(\s<A name=[0-9]+><\/a>)?/i | |
$brTag = /<br>/i | |
$bodyTag = /<body[^>]*>/i | |
$fileHeaderTag = /file.*<br>/i |
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
[core] | |
legacyheaders = false | |
excludesfile = /Users/<username>/.gitexclude | |
[repack] | |
usedeltabaseoffset = true | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[alias] |
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
#!/usr/bin/env ruby | |
# The script that give you focus! | |
# Create a text file that contains sites want to give yourself | |
# access to only during certain times of day. | |
# | |
# The file will look like this: | |
# 12 news.ycombinator.com | |
# 11-13,19-21 twitter.com | |
# |
OlderNewer