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 'transmission_api' | |
require 'pp' | |
class TorrentCli | |
def initialize(conf_file = "#{ENV['HOME']}/.torrent.conf") | |
@conf_file = conf_file | |
unless File.exist?(conf_file) | |
$stderr.puts "Config file does not exists. Default is : ~/.torrent.conf" | |
exit 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>{{ page.title }}</title> | |
<meta name="viewport" content="width=device-width"> | |
<!-- syntax highlighting CSS --> | |
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700' rel='stylesheet' type='text/css'> |
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 | |
def padded_tweet(message) | |
if message.size >= 140 | |
message[0..139] | |
elsif %w{. ! ? …}.include? message[-1] | |
message.ljust(140, message[-1]) | |
else | |
message.ljust(140, '!') | |
end |
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 | |
def padded_tweet(message) | |
if message.size >= 140 | |
return message[0..139] | |
end | |
if %w{. ! ? …}.include? message[-1] | |
return message.ljust(140, message[-1]) | |
end | |
return message.ljust(140, '!') |
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 | |
def padded_tweet(message) | |
if message.size >= 140 | |
return message[0..139] | |
end | |
dup = message.dup | |
if %w{. ! ? …}.include? message[-1] | |
return dup.ljust(140, message[-1]) | |
end |
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
class Follow < ActiveRecord::Base | |
belongs_to :follower, class_name: 'User' | |
belongs_to :followee, class_name: 'User' | |
end |
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
.bundle |
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
threads 0, Integer(ENV['MAX_THREADS'] || 10) | |
on_restart do | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.connection.disconnect! | |
FB::RedisPool.shutdown | |
end | |
workers Integer(ENV['WEB_CONCURRENCY'] || 3) |
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 todo { | |
vim ~/Dropbox/todos/$1.txt | |
} | |
function list-todo { | |
for i in ~/Dropbox/todos/*; do echo $(basename $i | cut -f 1 -d '.') ":" $(wc -l < $i); done | |
} | |
alias t='todo' | |
alias lt='list-todo' |
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
{ '@tadas_t' => ' 124553, | |
'@chrisbelpaire' => ' 124744, | |
'@floris' => ' 124798, | |
'@chucky4711' => ' 124960, | |
'@mr_foto' => ' 125077, | |
'@deogracia_974' => ' 125132, | |
'@christophePhilemotte' => ' 125267, | |
'@beanieboi' => ' 125469 } |