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' | |
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| |
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
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 |
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
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>+ |
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
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" |
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 'net/http' | |
class Song | |
def initialize | |
end | |
def sing | |
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
asdf | |
asdffds | |
sdfsadfsadfsdggds |
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 fibonacci(n) | |
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
#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 |
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
# 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 |
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
*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. |