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 'sinatra' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'sinatra/content_for' | |
| class String | |
| def to_slug | |
| ret = self.strip | |
| ret.gsub! /['`]/,"" |
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
| module ActiveSupport | |
| module Cache | |
| class SmartMemCacheStore < MemCacheStore | |
| alias_method :orig_read, :read | |
| alias_method :orig_write, :write | |
| def read(key, options = nil) | |
| lock_expires_in = options.delete(:lock_expires_in) if !options.nil? | |
| lock_expires_in ||= 30 |
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 'sinatra' | |
| require 'json' | |
| require 'httparty' | |
| class Http | |
| include HTTParty | |
| end | |
| jobs = {"governador" => 13, "senador" => 15, "deputado-federal" => 16, "deputado-estadual" => 17} |
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
| <%%= semantic_form_for @<%= singular_table_name %> do |form| %> | |
| <%%= form.inputs :id => :form_body %> | |
| <%%= form.buttons :commit, :id => :form_body %> | |
| <%% 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
| proc = Proc.new do |object| | |
| puts object.inspect | |
| 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
| set number | |
| set expandtab | |
| set tabstop=2 | |
| set shiftwidth=2 |
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 | |
| . /lib/lsb/init-functions | |
| PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
| DAEMON=/usr/sbin/nginx | |
| PS="nginx" | |
| PIDNAME="nginx" #lets you do $PS-slave | |
| PIDFILE=$PIDNAME.pid #pid file | |
| PIDSPATH=/var/run | |
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
| PS1='\n[\t \u] \[\033[1;33m\]\w\a\[\033[0m\]$(__git_ps1 " \[\033[1;32m\](%s)\[\033[0m\]")' | |
| PS1="$PS1 \[\033[1;32m\](\$(~/.rvm/bin/rvm-prompt))\[\033[0m\] \n\$ " |
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
| upstream my.balancer.load.com { | |
| server 80.80.80.80:8080; | |
| server 80.80.80.80:8181; | |
| server 81.81.81.81:8080; | |
| server unix:/path/to/your/socket; | |
| } | |
| server { | |
| listen 80; | |
| server_name balancer.load.com |
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
| <%= form_for(@post) do |f| %> | |
| <% end %> |