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
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha1" | |
"crypto/subtle" | |
"encoding/hex" | |
"fmt" | |
"os" | |
) |
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
# Configuration for Alacritty, the GPU enhanced terminal emulator | |
# Any items in the `env` entry below will be added as | |
# environment variables. Some entries may override variables | |
# set by alacritty it self. | |
env: | |
# TERM env customization. | |
# | |
# If this property is not set, alacritty will set it to xterm-256color. | |
# |
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
module StrongParamsHelpers | |
extend Grape::API::Helpers | |
def permitted_params | |
@permitted_params ||= declared(params, include_missing: false, include_parent_namespaces: false) | |
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
#log de commits locales que no se han pusheado | |
alias gl='git log --branches --not --remotes --decorate' | |
alias gs='git status' | |
alias gf='git fetch origin' | |
alias gd='git difftool --tool=meld -d HEAD &' | |
alias ga='git add -u .;git add .' | |
alias gb='git branch -a' | |
gr(){ | |
git reset $* |
SSH into Root
$ ssh [email protected]
Change Root Password
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
As your business logic gets complex you may need to implement transactions. The classic example is a bank funds transfer from account A to account B. If the withdrawal from account A fails then the deposit to account B should either never take place or be rolled back.
All the complexity is handled by ActiveRecord::Transactions
. Any model class or instance has a method named .transaction
. When called and passed a block, that block will be executed inside a database transaction. If there's an exception raised, the transaction will automatically be rolled back.
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
morse_dict = Hash.new({ | |
"a" => ".-", | |
"b" => "-...", | |
"c" => "-.-.", | |
"d" => "-..", | |
"e" => ".", | |
"f" => "..-.", | |
"g" => "--.", | |
"h" => "....", | |
"i" => "..", |
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 'bundler/capistrano' | |
set :application, "net" | |
set :repository, "[email protected]:net.git" | |
set :scm, :git | |
set :default_environment, { | |
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | |
} |
NewerOlder