Skip to content

Instantly share code, notes, and snippets.

@farfanoide
farfanoide / wifi_toggle.sh
Last active August 29, 2015 14:07
Script to toggle wifi card on a mac
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Simple script to toggle wifi on and off on a mac.
# It doesn't take many interfaces into account.
#
# ------------------------------------------------------------------------------
# Author
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Little script to jump between any tmux session and an always running one,
# received as an argument, ie: if you had a session 'main' and you always kept
# a named window 'Music', you could easily jump to it by calling this scipt
# like so:
# $ music_session_toggle "main:Music"
@farfanoide
farfanoide / bd.sh
Last active August 29, 2015 14:08
Script to manage a vagrant vm for docker with parallels provider
#!/usr/bin/env bash
# ---------------------------------------------------------------------------------------
# Description
# -----------
#
#
# Script to manage a vagrant vm for docker with parallels provider. If invoked
# from within tmux it'll set environment variables for all new windows
#
# Requirements:
function cd() {
# Aliases
alias cd=''
alias exit=''
# Variables
NONE='\033[00m'
RED='\033[01;31m'
SLEEP=`which sleep`
SEQ=`which seq`
#!/usr/bin/env bash
# echo $* sin nada >> /Users/farfanoide/Desktop/corrio && exit
[ $# -eq 0 ] && exit 1
# Variables
PARENT_COMMAND=$1; shift
OS="$(uname)"
CRONJOB="*/1 * * * * ${0} cron"
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Simple script to toggle bluetooth on and off on a mac.
# Depends on:
# - blueutil: (https://github.com/toy/blueutil)
#
# ------------------------------------------------------------------------------
#!/bin/bash
RUTAS="/bin;/usr/bin;/usr/local/bin"
#------------------
# Helper functions
#------------------
_first_word() { echo "$*" | cut -d ' ' -f 1 ;}
_remove_first_word() {

Patrones

Adapter

Convierte la interfaz de una clase en otra distinta que es la que esperan los clientes. Permite que cooperen clases que de otra manera no podrian por tener interfaces incompatibles.

Optimizando CtrlP

Problema: [ctrlp][ctrlp] tarda mucho en indizar el path actual.

Update

Podemos resolver todo esto y mas con tan solo instalar [fzf][]

Es remarcable la poca configuracion que necesitamos con este cambio:

Manejo de Plugins

Problema: quiero instalar plugins.

Hay varias alternativas para manejar plugins, yo particularmente utilizo [plug][]

¿por que? simplemente por velocidad, plug permite instalacion asincrona de plugins. Para instalarlo solo necesitamos bajarlo a una carpeta que vim carga por defecto: