๐
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/env ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
BASE_URL = "http://www.kniteforcerevolution.com" | |
PAGE_URL = "#{BASE_URL}/music/" | |
FILE_URL = "#{BASE_URL}/file_download/" | |
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/env ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
BASE_URL = "http://www.kniteforcerevolution.com" | |
PAGE_URL = "#{BASE_URL}/music/" | |
FILE_URL = "#{BASE_URL}/file_download/" | |
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/env ruby -w | |
def find_caseinsensitive_duplicates(dir) | |
# INIT | |
conflicts = {} | |
# Load file list | |
files = Dir.entries(dir).collect{|f| f.downcase } | |
# Do yo thang! |
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/env ruby | |
# Git - Select Add | |
# Written by: Gianni Chiappetta <gianni[at]runlevel6[dot]org> | |
require 'rubygems' | |
require 'git' # http://github.com/schacon/ruby-git | |
MODES = { | |
"M" => "Modified" |
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
var Hoverer = { | |
current: null, | |
delay: 0.5, | |
timer: null, | |
handler: function(event) { | |
var element = event.findElement('div.nav_menu'); | |
if (!element) | |
return Hoverer.leave(); | |
if (element == Hoverer.current) |
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
function getScrollbarWidth() { | |
if (this.scrollbarWidth) { | |
return this.scrollbarWidth; | |
} | |
var inner = document.createElement('p'); | |
inner.style.width = '100%'; | |
inner.style.height = '200px'; | |
var outer = document.createElement('div'); | |
outer.style.position = 'absolute'; |
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 'packr' | |
namespace :js do | |
desc "Pack javascript src for production environment" | |
task :pack => :environment do | |
# Files to pack | |
Dir.glob(File.join("public", "javascripts", "**", "*.js")).each do |filename| | |
puts "packing #{filename}..." | |
FileUtils.cp(filename, "#{filename}.orig") | |
js = "" |
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
# Get the absolute value of a phone number | |
def abs_phone(phone) | |
abs = [] | |
phone = phone.gsub(/[^a-zA-Z0-9]/, '').downcase | |
phone.each_byte do |b| | |
case b | |
when 0..96 | |
abs << (b - 48) | |
when 122 | |
abs << ((((b-97).to_f/3.0)+1.0).round) |
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
Element.addMethods({ | |
viewable: function(el) { | |
// INIT | |
el = $(el); | |
var scroll = document.viewport.getScrollOffsets(); | |
var viewport = document.viewport.getDimensions(); | |
var offsets = el.cumulativeOffset(); | |
var dimensions = el.getDimensions(); | |
// Sanity check |
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
tell application "iTerm" | |
activate | |
-- Close the first session | |
terminate the first session of the first terminal | |
-- New Terminal | |
set myterm to (make new terminal) | |
tell myterm | |
-- Tab 1 (Server) | |
launch session "Default" |
OlderNewer