Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Fernando Perales FerPerales

🎯
Focusing
View GitHub Profile
@FerPerales
FerPerales / pihole_run.sh
Created Aug 13, 2020 — forked from PiotrKrzyzek/pihole_run.sh
Config and run pihole in Docker on MacOS
View pihole_run.sh
#!/bin/bash
# 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.
DOCKER_CONFIGS="~/.pihole"
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
FerPerales / gist:7276d3c6425e725ed91106094c9737aa
Created Apr 23, 2019 — forked from arwagner/gist:1323952
Combinatorial explosion and testing
View gist:7276d3c6425e725ed91106094c9737aa
I found http://groups.google.com/group/growing-object-oriented-software/browse_thread/thread/47695af2c6b5adda 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
end
def decide
return true if @user.is_gold_member?
@FerPerales
FerPerales / delete-evicted-pods-all-namespaces.sh
Created Oct 22, 2018 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
View delete-evicted-pods-all-namespaces.sh
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# 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
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

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
https://www.googleapis.com/youtube/v3/search?type=video&q={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
FerPerales / setup.md
Last active Aug 1, 2017 — forked from jamiesoncj/setup.md
Set up Franz for Ubuntu
View setup.md
  • Download Franz for your distribution from MeetFranz.com
  • 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]
Name=Franz
Comment=