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 'rails_helper' | |
RSpec.describe AdminsController, type: :controller do | |
describe 'GET #index' do | |
it 'returns http success' do | |
get :index | |
expect(response).to have_http_status(:success) | |
end | |
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
Shift + right click = waypoint commands | |
Ctrl+arrow keys = rotate in place | |
Alt+left click = keep units in formation and move them | |
Alt+ctrl+left click = Rotate and move in formation | |
Ctrl+g = group lock | |
Backspace = stop |
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
Ç = alt + 128 | |
ü = alt + 129 | |
é = alt + 130 | |
â = alt + 131 | |
ä = alt + 132 | |
à = alt + 133 | |
å = alt + 134 | |
ç = alt + 135 | |
ê = alt + 136 | |
ë = alt + 137 |
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
colour = "%06x" % (rand * 0xffffff) |
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
routes = Rails.application.routes.routes | |
routes = Workflow::Engine.routes.routes | |
@paths = routes.collect {|r| r.path.spec.to_s } | |
https://gist.github.com/bantic/5688232 |
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
# Alter repository remote | |
git remote set-url origin [email protected]:user/your_repository.git | |
# Delete the last commit | |
$ git reset HEAD^ --hard | |
$ git push origin -f |
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
psql -U postgres -h localhost base_development < ~/Desktop/dump_user-27072016 |
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
# Listar as chaves que começam com redis_user_permission | |
KEYS redis_user_permission* | |
# Listar um determinado número de elementos de uma lista (Somente para valores que sejam lista) | |
LRANGE redis_user_permission:1:engines 0 9 | |
# Obtem o valor da chave informada (Somente para valores que sejam string) | |
GET redis_user_permission:1:user_id | |
# Apaga um chave no Redis | |
DEL nome_da_chave | |
Ex. DEL redis_user_permission:1:engines |
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 "mechanize" | |
agent = Mechanize.new | |
page = agent.get("http://esaj.tjce.jus.br/cpopg/open.do") | |
form = page.form_with(:name => "consultarProcessoForm") | |
page.form_with(:name => "consultarProcessoForm") do |form| | |
form.fields.each do |field| | |
field.value = field.options.detect { |option| option.value == "NUMPROC"}.value if field.name == "cbPesquisa" |
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 Hash | |
module Using | |
def using(&block) | |
values = block.parameters.map do |type, name| | |
self[name] | |
end | |
block.call(*values) | |
end | |
end |