Skip to content

Instantly share code, notes, and snippets.


Fernando Perales FerPerales

View GitHub Profile
FerPerales /
Created Aug 13, 2020 — forked from PiotrKrzyzek/
Config and run pihole in Docker on MacOS
# I've set this up to use my static IP, instead of dynamically getting one.
# Why? Because if my IP keeps changing, then how is the router supposed to constantly find it?!
# I set a static IP for this computer, and that is that.
IP="YOUR local static IP here"
# Default of directory you run this from, update to where ever.
View .vimrc
call plug#begin('~/.vim/plugged')
" Git plugins
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'airblade/vim-gitgutter'
" Search files
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'ctrlpvim/ctrlp.vim'
View asciiputsonglasses
Puts on glasses:
( •_•)>⌐■-■
Takes off glasses ("mother of god..."):
( •_•)>⌐■-■
FerPerales / gist:7276d3c6425e725ed91106094c9737aa
Created Apr 23, 2019 — forked from arwagner/gist:1323952
Combinatorial explosion and testing
View gist:7276d3c6425e725ed91106094c9737aa
I found fascinating, so I decided to make it a little more concrete. It's also in ruby using rspec, sorry about that. Here's the code under test:
class EligibleForDiscountPolicy
def initialize transaction, user
@transaction = transaction
@user = user
def decide
return true if @user.is_gold_member?
FerPerales /
Created Oct 22, 2018 — forked from psxvoid/
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
# based on
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

View gist:17b01e16fd2d25344024791909a03da0{BUSQUEDA}&maxResults=25&part=snippet&key={API_KEY}
View .vimrc
" Set max chars in column
set colorcolumn=110
" Colorize extra whitespaces at the end of a line
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
" Auto delete whitespaces on save
FerPerales /
Last active Aug 1, 2017 — forked from jamiesoncj/
Set up Franz for Ubuntu
  • Download Franz for your distribution from
  • sudo mkdir /opt/franz
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-4.9.4.tgz -C /opt/franz
  • sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]