Skip to content

Instantly share code, notes, and snippets.

@fn-alves
fn-alves / validate_url.sh
Created November 3, 2017 20:40
bash wget - function check is valid file at url before downloading
#!/usr/bin/env bash
# simple function to check http response code before downloading a remote file
# usage:
# if `isValidUrl $url >/dev/null`; then dosomething ; else echo "url does not exist!" ; fi
function isValidUrl() {
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]] ; then
echo "true"
fi
}
@fn-alves
fn-alves / .colors
Last active October 30, 2017 00:27
.colors
export COLOR_NC='\e[0m' # No Color
export COLOR_WHITE='\e[1;37m'
export COLOR_BLACK='\e[0;30m'
export COLOR_BLUE='\e[0;34m'
export COLOR_LIGHT_BLUE='\e[1;34m'
export COLOR_GREEN='\e[0;32m'
export COLOR_LIGHT_GREEN='\e[1;32m'
export COLOR_CYAN='\e[0;36m'
export COLOR_LIGHT_CYAN='\e[1;36m'
export COLOR_RED='\e[0;31m'
@fn-alves
fn-alves / .zshrc
Last active October 22, 2017 18:55
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/fnx01lv3/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set leader key & Python bin (neovim only) "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader="\<Space>"
if has('nvim')
let g:python_host_prog = '/home/fNxONE/.virtualenvs/neovim3/bin/python'
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@fn-alves
fn-alves / .profile
Last active October 23, 2017 16:40
###############################################################################
# General settings and configuration #
###############################################################################
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#source ~/.env
###############################################################################
# Third party packages settings and configuration #
###############################################################################
.DS_Store
.python-version
.ropeproject
*.swp
*.pyc
*.sublime-project
*.sublime-workspace
readme.html
[user]
name = Fernando Alves
email = fNxONE@users.noreply.github.com
[color]
diff = auto
status = auto
branch = auto
ui = true
###############################################################################
# Source .profile #
###############################################################################
source ~/.profile
source ~/.colors
###############################################################################
# Third party packages settings and configuration #
###############################################################################
@fn-alves
fn-alves / bootstrap.sh
Last active October 9, 2017 17:05
Computer bootstrap
#!/bin/bash
##############################################################################
# Install system packages #
##############################################################################
# if apt-get exists, probably it's a Linux
if which apt-get > /dev/null; then
# update & clean up
@fn-alves
fn-alves / alias_git.txt
Created October 2, 2017 20:29
Custom alias of bash windows/unix for gitz
#__Alias do git__#
git config --global alias.co checkout
git config --global alias.lg 'log --all --graph --decorate --oneline --abbrev-commit'
git config --global alias.hist 'log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
git config --global alias.cm commit
git config --global alias.ac '!git add -A && git commit'
git config --global alias.st 'status -sb'
git config --global alias.tags 'tag -l'
git config --global alias.branches 'branch -a'
git config --global alias.remotes 'remote -v'