Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'twitter'
config = File.exists?("#{ENV['HOME']}/.twitter") ? YAML::load(open("#{ENV['HOME']}/.twitter")) : Hash.new
if config.empty?
print "> what was the comsumer token twitter provided you with? "
config['token'] = gets.chomp
print "> what was the comsumer secret twitter provided you with? "
config['secret'] = gets.chomp
File.open( "#{ENV['HOME']}/.twitter", 'w' ) do |out|
reg2=/^[\w!#\$%&'*+\/=?`{|}~^-]+ #only allow to start with these symbols
(?:\.[\w!#\$%&'*+\/=?`{|}~^-]+)* # the user name can contain dot
@ # @ symbol
(?:[a-zA-Z0-9-]+\.)+ # domain
[a-zA-Z]{2,6}$ # the last part of domain
/x # ignore spaces
reg=/(?<allow_char> [\w!#\$%&'*+\/=?`{|}~^-]+){0} #only allow to start with these symbols
^(?<!\<script)(\g<allow_char>+)
(?:\.\g<allow_char>)* # the user name can contain dot
reg2=/^[\w!#\$%&'*+\/=?`{|}~^-]+ #only allow to start with these symbols
(?:\.[\w!#\$%&'*+\/=?`{|}~^-]+)* # the user name can contain dot
@ # @ symbol
(?:[a-zA-Z0-9-]+\.)+ # domain
[a-zA-Z]{2,6}$ # the last part of domain
/x # ignore spaces
reg=/(?<allow_char> [\w!#\$%&'*+\/=?`{|}~^-]+){0} #only allow to start with these symbols
(?<script_tag> script){0}
^\g<allow_char>+
class Song
def initialize
@bottles = 99
end
def sing
@bottles.downto(0) do |bottle|
if bottle > 1
puts "#{bottle} bottles of beer on the wall, #{bottle} bottles of beer."
puts "Take one down and pass it around, #{bottle - 1} bottles of beer on the wall.\n"
require 'net/http'
class Song
def initialize
end
def sing
end
end
asdf
asdffds
sdfsadfsadfsdggds
def fibonacci(n)
end
#by RoBeRt
#check the 'distance' between new posts/anwers and old ones for the same user
require 'text'
module DuplicationFilter
def duplicate_content?
@duplicate
end
# Redis configuration file example
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no
# Accept connections on the specified port, default is 6379
port 6379
# If you want you can bind a single interface, if the bind option is not
@ruanwz
ruanwz / FAQ
Created February 27, 2009 12:09
*vim-ruby.txt* *vim-ruby* *vim-ruby-faq*
VIM/RUBY CONFIGURATION FILES
The vim-ruby Project FAQ
http://vim-ruby.rubyforge.org
The vim-ruby project maintains Ruby-related configuration files for Vim. This
FAQ contains all you need to know about it.