Skip to content

Instantly share code, notes, and snippets.

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
# Git
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
# More Git
@moisesnarvaez
moisesnarvaez / email_finder.rb
Last active October 11, 2016 21:36
Finds a valid email giving a Fullname and a URL. Example: e = EmailFinder.new("Moises Narvaez", "www.koombea.com"); e.valid_email
class EmailFinder
# TODO: para TopSpeed: Buscar si hay una "@" en el author, si es así...
# Buscar si en el texto de author hay algún texto extre paréntesis "()"
# si ese texto es un email, quitarlo (con los parentesis), sino cogerlo como nombre
def initialize(full_name, url)
@full_name = I18n.transliterate(full_name.downcase)
@url = url
@words = @full_name.split(' ')
end
Pre-requisites:
- adb
- fastboot
1. Install Custom Recovery Image
- Download "TWRP Recovery", once downloaded, rename the file to "recovery.img"
- Run in Console:
adb devices
@moisesnarvaez
moisesnarvaez / config_files
Created June 25, 2018 19:41
Sublime Configuration
Key Bindings
================
{ "keys": ["super+shift+r"], "command": "reveal_in_side_bar" }
User Preferences
================
{
"ignored_packages":
@moisesnarvaez
moisesnarvaez / tables_size.sql
Created April 25, 2019 15:31
PostgreSQL tables size
SELECT
schema_name,
relname,
pg_size_pretty(table_size) AS size,
table_size
FROM (
SELECT
pg_catalog.pg_namespace.nspname AS schema_name,
relname,
@moisesnarvaez
moisesnarvaez / cloudSettings
Last active October 1, 2021 21:36
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-01T02:28:13.368Z","extensionVersion":"v3.4.3"}

Kubernetes

CRUD Deployments

kubectl create deployment [name] --image=[Image from Docker] = Creates a deployment, with the default Blueprint

kubectl edit deployment [name] = Edits the deployment blueprint

kubectl get all = Lists all the components in the Cluster

openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config <(printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
mkdir ~/certs/
mv localhost.crt ~/certs/
mv localhost.key ~/certs/

bin/rails s -b "ssl://127.0.0.1:3000?key=$HOME/certs/localhost.key&cert=$HOME/certs/localhost.crt"