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
require 'rubygems' | |
require 'twitter' | |
auth = Twitter::HTTPAuth.new 'planeta_spfc', 'xxxxxxxxxxx' | |
base = Twitter::Base.new auth | |
base.followers.select { |f| !f.following }.each do |f| | |
begin | |
base.friendship_create f.id | |
rescue |
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
!!! XML | |
!!! | |
%html | |
%head | |
%title | |
= javascript_include_merged :base | |
= stylesheet_link_merged :base | |
%body= yield |
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
# Quick Markdown to HTML Conversion Script | |
# http://blog.rubyhead.com/2010/05/05/quick-markdown-to-html-conversion-script | |
require 'rubygems' | |
require 'bluecloth' | |
source_file = $*[0] | |
output_file = $*[1] | |
content = File.read(source_file) |
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
require "openssl" | |
require "net/smtp" | |
Net::SMTP.class_eval do | |
private | |
def do_start(helodomain, user, secret, authtype) | |
raise IOError, 'SMTP session already started' if @started | |
#check_auth_args user, secret, authtype if user or secret | |
check_auth_args user, secret, authtype # Mudei esta linha, incluindo o authtype |
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
# Time stamp file names for backups or archives | |
# http://www.24hourapps.com/2009/02/linux-tips-8-time-stamp-file-names-for.html | |
# When doing simply backups (non-incremental) it is useful to be able to automatically | |
# time stamp or date stamp file names. This makes archives much easier to navigate when | |
# it comes time to retrieve a backup. | |
# The command for doing this is quite simple. To just create a file with a time stamped file name, | |
# use the following command: |
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
# Find recently modified files | |
# http://www.24hourapps.com/2009/02/linux-tips-9-find-recently-modified.html | |
# Back when I was developing at a company where no version control systems were used and CSV | |
# was the pain it still is now, going without a system at all was preferable than trying to | |
# get a working CSV system. However as expected I often find my self unable to find some code | |
# that has been overridden by a college and would find it difficult to locate the files he had | |
# changed. | |
# Luckily find, the Linux command, is quite powerful and can show you a list of all recently |
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
# Rename multiple files | |
# http://www.24hourapps.com/2009/03/linux-tips-10-rename-multiple-files.html | |
# Renaming multiple files in Linux is surprisingly difficult given the simplistic power | |
# provided by many other system commands. Unlike DOS, which provided a rename command that | |
# allowed wild cards, Linux's rename/mv command is less versatile. Therefore to rename files one needs to write a loop. Luckily bash helps a lot here. | |
# Lets say we have in our directory a number of .txt files that we need to rename to .nfo. | |
# To do this we would need to use the command: |
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
# Find and replace text in multiple files | |
# http://www.24hourapps.com/2009/03/linux-tips-17-find-and-replace-text-in.html | |
# Multiple file find and replace is a rarely used, but an extremely time saving, ability of | |
# Linux that I cannot live without. It can be achieved by chaining a few commands together | |
# to get the list of files you want to change (find), make sure the files contain the strings | |
# you want to replace (grep), and do the replacements (sed). | |
# Lets say we have a lot of code that uses the function registerUser that was implemented when | |
# there was only one class of users, but now another class of users need to access the system |
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
# Execute a ruby script from Gist | |
ruby -e "$(curl http://gist.github.com/raw/323731/install_homebrew.rb)" |
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
# Autotest specs with Watchr | |
# http://bjhess.com/blog/2010/2/23/setting_up_watchr_and_rails/ | |
# Run me with: | |
# $ watchr specs.watchr | |
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) |
OlderNewer