Skip to content

Instantly share code, notes, and snippets.

View falvarez's full-sized avatar

Federico J. Álvarez Valero falvarez

View GitHub Profile
@falvarez
falvarez / 0_reuse_code.js
Created September 27, 2013 05:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@falvarez
falvarez / gist:8434057
Created January 15, 2014 10:33
CSS Vertical alignment (Method 1)
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@falvarez
falvarez / .bash_profile
Last active August 16, 2019 12:56
ssh host autocompletion for macOS
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@falvarez
falvarez / .bash_profile
Created October 6, 2016 14:19
Show/hide hidden files in Finder macOS
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
#!/usr/bin/env bash
mkdir -p ~/Development/docker/mysql
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=mysql -v ~/Development/docker/mysql:/var/lib/mysql -p 3306:3306 mysql/mysql-server:5.7
@falvarez
falvarez / .bash_profile
Created December 7, 2016 15:20
ll shortcut
alias ll='ls -l'
@falvarez
falvarez / .bash_profile
Created December 7, 2016 15:21
git prompt
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
GIT_PROMPT_ONLY_IN_REPO=1
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
fi
@falvarez
falvarez / encoding-video.md
Created November 6, 2017 09:19 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@falvarez
falvarez / docker-shell.sh
Created January 24, 2018 08:10
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash