Skip to content

Instantly share code, notes, and snippets.

View eubide's full-sized avatar
🚀
Rocket science

Eduardo Ubide eubide

🚀
Rocket science
View GitHub Profile
@eubide
eubide / iterm2.md
Created May 5, 2022 12:40 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@eubide
eubide / config_ssh
Created February 21, 2021 07:41
config
Host *
TCPKeepAlive yes
ServerAliveInterval 30
ServerAliveCountMax 6
Compression yes
ControlMaster auto
ControlPath ~/.ssh/cm_socket/%r@%h:%p
ControlPersist 1h
@eubide
eubide / bash_script_template.sh
Last active January 16, 2021 23:09
minimal-safe-bash-script-template
#!/usr/bin/env bash
# https://betterdev.blog/minimal-safe-bash-script-template/
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF

Keybase proof

I hereby claim:

  • I am eubide on github.
  • I am eubide (https://keybase.io/eubide) on keybase.
  • I have a public key ASDXZz39MqttS4q2J7M0LQjPfTUWCR9Y4ndNWZNa6HQpYQo

To claim this, I am signing this object:

@eubide
eubide / text.py
Created April 10, 2020 12:13 — forked from gallir/text.py
Very fast function to get cosine similarity between 2 short texts, where counting the number of words is no needed (i.e. binary bag of words) but it works pretty well with non-ascii weird characters.
from unidecode import unidecode
import re
import sys
import inflection
import numpy as np
import math
from collections import defaultdict
# Using cosine_similarity, own faster implementation, inspired by
# https://towardsdatascience.com/calculating-string-similarity-in-python-276e18a7d33a
@eubide
eubide / .psqlrc
Last active February 23, 2021 17:43
psqlrc file
-- .psqlrc
\set QUIET ON
\set PROMPT1 '(%n@%m:%>) %`date +%H:%M:%S` [%/] \n%x%# '
\set PROMPT2 '> '
\set PAGER OFF
\set HISTFILE ~/.psql_history- :HOST - :USER -:DBNAME
\set HISTSIZE 2000
\set ECHO_HIDDEN OFF