Skip to content

Instantly share code, notes, and snippets.

View emaiax's full-sized avatar
🌵

Eduardo Maia emaiax

🌵
View GitHub Profile
class Api::V1::BaseController < ApplicationController
protect_from_forgery with: :null_session
serialization_scope :current_user
include ResourceLoader
include TokenAuthentication
after_action :build_response_headers
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 3, 2024 12:26
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@jtadeulopes
jtadeulopes / server.md
Last active March 29, 2024 10:23
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@olegykz
olegykz / deploy.rb
Created November 15, 2012 15:34 — forked from stympy/deploy.rb
Skip asset pre-compilation when deploying if the assets didn't change
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
begin
from = source.next_revision(current_revision) # <-- Fail here at first-time deploy because of current/REVISION absence
rescue
err_no = true
end
if err_no || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
module MTG
module API
PATH = "http://gatherer.wizards.com/Pages"
SEARCH = "/Search/Default.aspx?output=checklist&action=advanced"
CARD = "/Card/Details.aspx?multiverseid="
MID_SELECTOR = '.nameLink'
MAIN_SELECTOR = '#ctl00_ctl00_ctl00_MainContent_SubContent_SubContent_'
NAME_SELECTOR = MAIN_SELECTOR + 'nameRow .value'