Skip to content

Instantly share code, notes, and snippets.

@tiagoamaro
tiagoamaro / Preferences sublime (User Settings).json
Last active December 15, 2015 13:38
Sublime Text 3 Configuration
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Decent Color Scheme/Samuel's decent.tmTheme",
"detect_indentation": true,
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_size": 14,
"highlight_line": true,
"highlight_modified_tabs": true,
ZSH=$HOME/.oh-my-zsh # Path to your oh-my-zsh configuration
ZSH_THEME="bira"
COMPLETION_WAITING_DOTS="true"
# Plugin repositories:
# => https://github.com/zsh-users/zsh-autosuggestions
# => https://github.com/zsh-users/zsh-syntax-highlighting
plugins=(zsh-autosuggestions zsh-syntax-highlighting)
# Fix zsh-syntax-highlight slow pasting
@tiagoamaro
tiagoamaro / .conkyrc
Last active December 16, 2015 18:20
Conky Configuration File, based on corenominal <http://corenominal.org> '.conkyrc' .This config file is used under crunchbang distro <http://crunchbang.org/>
# .conkyrc by Tiago Amaro <github.com/tiagoamaro>
# customized conkyrc config, based on crunchbang thread: http://crunchbang.org/forums/viewtopic.php?id=59
# customized for my needs (strongly) based on corenominal .conkyrc
#
# This Conky config is based in a four processor machine. If you have less or more processors, change at your will :)
background no
use_xft yes
xftfont Sans:size=8
xftalpha 1
@tiagoamaro
tiagoamaro / install_ruby.sh
Last active December 17, 2015 05:49
Installing ruby 2.0.0-p0 (using rbenv) with readline support
#!/bin/bash
#This script needs rbenv and ruby-build
#Rbenv: https://github.com/sstephenson/rbenv/
#Ruby Build: https://github.com/sstephenson/ruby-build
#Installation variables
#Choose your ruby version and readline path
RUBY_VERSION=2.0.0-p0
READLINE_PATH=/usr/include/readline
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
sudo apt-get build-dep ruby1.9.1
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar xzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure
make
sudo checkinstall -y --pkgversion 2.0.0-p247 --provides "ruby-interpreter"
@tiagoamaro
tiagoamaro / deploy.rb
Last active December 21, 2015 11:59
Capistrano task for compiling tasks locally
# UPDATE: This will only work for Capistrano 2.x and probably will not work for Capistrano 3.
#
# This Gist was based on fernando blat post: (http://fernando.blat.es/post/12563486374/optimize-deploy-time-compiling-your-assets-locally)
set :rails_env, 'production'
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile do
run_locally('rm -rf public/assets/*')
@tiagoamaro
tiagoamaro / deploy.rb
Last active December 21, 2015 12:38 — forked from ayamomiji/deploy.rb
# Check if remote file exists
def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end
# Check if process is running
def remote_process_exists?(pid_file)
capture("ps -p $(cat #{pid_file}) ; true").strip.split("\n").size == 2
end
@tiagoamaro
tiagoamaro / .vimrc
Last active December 22, 2015 19:19
.vimrc file
" ------------------------------------------------------------------------------
" FILE: .vimrc
" DESCRIPTION: Vim configuration file. Strongly based on vasconcelloslf .vimrc :)
" AUTHOR: Tiago Amaro (github.com/tiagoamaro)
" ------------------------------------------------------------------------------
set rtp+=~/.vim/bundle/vundle/
" Vundle
set nocompatible