package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha1" | |
"crypto/subtle" | |
"encoding/hex" | |
"fmt" | |
"os" | |
) |
# 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. | |
# |
module StrongParamsHelpers | |
extend Grape::API::Helpers | |
def permitted_params | |
@permitted_params ||= declared(params, include_missing: false, include_parent_namespaces: false) | |
end | |
end |
#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 $* |
-
Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.
-
Reset PS3 controller by inserting paperclip into pinhole near L2 button.
-
Connect PS3 controller to Mac with USB cable.
-
Enable Bluetooth.
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
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.
morse_dict = Hash.new({ | |
"a" => ".-", | |
"b" => "-...", | |
"c" => "-.-.", | |
"d" => "-..", | |
"e" => ".", | |
"f" => "..-.", | |
"g" => "--.", | |
"h" => "....", | |
"i" => "..", |