Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
# Logfile created on 2016-10-13 00:51:33 -0300 by logger.rb/47272
INFO ---------------------------------------------------------------------------
INFO START 2016-10-13 00:51:33 -0300 cap stage deploy
INFO ---------------------------------------------------------------------------
DEBUG [cab7766a] Running [ -d ~/.rvm ] as ec2-user@stage.thisopenspace.com
DEBUG [cab7766a] Command: [ -d ~/.rvm ]
DEBUG [cab7766a] Finished in 3.527 seconds with exit status 0 (successful).
DEBUG [32829e9c] Running ~/.rvm/bin/rvm version as ec2-user@stage.thisopenspace.com
DEBUG [32829e9c] Command: ~/.rvm/bin/rvm version
DEBUG [32829e9c] rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
task :set_annotation_options do
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults({
'position_in_routes' => "after",
'position_in_class' => "after",
set nocompatible " be iMproved
" ---------------------------------------------------------------------------
" Plugins
" ---------------------------------------------------------------------------
call plug#begin('~/.vim/plugged')
" Autocomplete
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh --clang-completer' }
@AlexVKO
AlexVKO / property.rb
Created May 3, 2016 20:28
Model property
class Property < ApplicationRecord
# => Relations
belongs_to :customer
has_many :notes, as: :notable
has_many :work_orders
# => Serializer and accessors
serialize :general_informations, HashSerializer
store_accessor :general_informations, :has_dogs, :gate_code
@AlexVKO
AlexVKO / scheduled_at_in_words.rb
Created April 16, 2016 05:45
A cool method to display Date time
def scheduled_at_in_words
time = object.scheduled_at
st = Time.now.beginning_of_day
nd = Time.now.end_of_day
case
when time.between?(st + 1.day, nd + 1.day)
"Tomorrow #{time.strftime('%H:%M')}"
when time.between?(st, nd)
"Today #{time.strftime('%H:%M')}"
when time.between?(st - 1.day, nd - 1.day)
@AlexVKO
AlexVKO / database.rake
Created March 26, 2016 22:50
rake drop database
require 'active_record/connection_adapters/postgresql_adapter'
module ActiveRecord
module ConnectionAdapters
class PostgreSQLAdapter < AbstractAdapter
def drop_database(name)
raise "Nah, I won't drop the production database" if Rails.env.production?
execute <<-SQL
UPDATE pg_catalog.pg_database
SET datallowconn=false WHERE datname='#{name}'
SQL
@AlexVKO
AlexVKO / ctags.setup
Created March 12, 2016 19:51 — forked from nazgob/ctags.setup
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@AlexVKO
AlexVKO / .vimrc
Created January 18, 2016 00:51 — forked from gosukiwi/.vimrc
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@AlexVKO
AlexVKO / alexvko.zsh-theme
Created December 29, 2015 22:11
oh-my-zsh theme
# local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
# %{$fg_bold[green]%}%c %{$reset_color%}$(work_in_progress)%{$fg_bold[blue]%} % %{$reset_color%}
PROMPT='
%{$fg[blue]%}%c%{$reset_color%} $(git_prompt_info)%{$fg_bold[blue]%} %{$reset_color%}
> '
RPROMPT='${_current_dir}'
ZSH_THEME_GIT_PROMPT_PREFIX="on %{$fg_bold[white]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}! %{$reset_color%}"
@AlexVKO
AlexVKO / common-aliases.plugin.zsh
Created December 29, 2015 22:11
common-aliases.plugin.zsh
# Advanced Aliases.
# Use with caution
#
# Open Sublime text
alias ss="subl ."
# Custom
alias workspace='cd ~/workspace'