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 'colored' | |
def add_desert_require | |
sentinel = 'Rails::Initializer.run do |config|' | |
gsub_file 'config/environment.rb', /(#{Regexp.escape(sentinel)})/mi do |match| | |
"\nrequire 'desert'\n#{match}" | |
end | |
end | |
def gsub_file(path, regexp, *args, &block) |
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
# Lighter -- Campfire from the command line | |
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail | |
require "rubygems" | |
require "tinder" | |
require "readline" | |
require "highline/import" | |
class Lighter | |
def initialize(room) | |
@room = room |
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
# Mimic Mac OS X Finder's sort by name. | |
class Array | |
def finder_sort | |
sort { |a, b| a.to_finder_sort <=> b.to_finder_sort } | |
end | |
end | |
class String | |
def to_finder_sort | |
result = self.dup |
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
javascript:location.href='http://readcycling.com/?input_url='+encodeURIComponent(location.href) |
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
javascript:location.href='http://readcycling.com/?input_url='+encodeURIComponent(location.href) |
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
#!/bin/sh -e | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
year=`date "+%Y"` | |
cat <<EOF | |
Copyright (c) $year Aitor García | |
Permission is hereby granted, free of charge, to any person obtaining |
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 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'icalendar' | |
require 'date' | |
include Icalendar | |
class IrekiaCalendar | |
BASE_URL = "http://irekia.euskadi.net/es/dept/all/events?archive=f" |
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
# How fucking fucked can the most fucked up company get when messing around when formats? | |
# Well, really fucked. | |
# So fix their fucking mess: Telefonica pk7 invoices to pdf | |
# Use: ruby fucktura.rb file_name.pk7 | |
require 'base64' | |
FACT_LABEL=/<FACB64>(.*)<\/FACB64>/m | |
fucktura = File.open(ARGV[0]).read[FACT_LABEL, 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
Nameservers for .de domains: | |
* The first 3 bits of the IP address (C-class) is different for each nameserver. | |
* A glue record is necessary for the domain on the nameservers. | |
* The SOA (Start of Authority) must be within the guidelines. | |
* The domain MX record must resolve to a mail server that is valid for the life of the domain registration. | |
* The DNS servers must be located on two distinct class C networks. | |
* The zone files for both nameservers must have matching serial numbers. | |
* The primary and secondary hosts specified in both zone files must match the first and second nameservers entered. |
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
[aitor@Sofocles:~ 14:13:21] ruby -e 'puts "¿" =~ /\W/' | |
0 | |
[aitor@Sofocles:~ 14:13:24] ruby -v | |
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] |