Skip to content

Instantly share code, notes, and snippets.

View matiasleidemer's full-sized avatar

Matias H. Leidemer matiasleidemer

View GitHub Profile
set nocompatible " be iMproved, required
set number " shows line numbers
set relativenumber " show relative line numbers
set hlsearch " highlight search results
set cursorline " highlight cursor line
set laststatus=2 " this is needed for airline
set visualbell " no sounds
set colorcolumn=80 " column with 80
set wildmode=list " expand and folders/tabs when opening a file
set backspace=2 " makes backspace work as it should work
@matiasleidemer
matiasleidemer / set_pantheon_terminal_solarized
Created January 7, 2016 23:40 — forked from anonymous/set_pantheon_terminal_solarized
Sets Pantheon Terminal (Elementary OS) to Solarized Theme
#!/bin/bash
echo
echo "This script sets the pantheon terminal to the Solarized theme."
echo
until [[ $scheme -eq 1 ]] || [[ $scheme -eq 2 ]] || [[ $scheme -eq 3 ]]; do
echo "Choose one:"
echo "1) Light"
echo "2) Dark"
@matiasleidemer
matiasleidemer / checkout.rb
Last active November 30, 2015 19:30
Ruby kata 9
class CheckOut
end
➜ rails-dev-box git:(master) vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise32'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: rails-dev-box_default_1413151445914_14468
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 3000 => 3000 (adapter 1)
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Tomorrow-Night.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
# usando @user= dentro de um before(:each)
rspec spec/models/user_spec.rb
.........................................................
Finished in 46.62 seconds
57 examples, 0 failures
Randomized with seed 60306
@matiasleidemer
matiasleidemer / gist:2989298
Created June 25, 2012 15:34
Como trabalhar com múltiplas contas no heroku

Criar uma nova chave ssh para sua nova conta:

ssh-keygen -t rsa -C "[email protected]" -f ~/.ssh/id_rsa_sua_conta_heroku

Fazer login na nova conta:

heroku auth:login

Fazer upload da nova chave pública gerada:

# encoding: UTF-8
class EmailsController < ApplicationController
def plano
@plano = Plano.find(params[:plan_id], include: [:assistencias])
Notifier.plano(params[:recipients], @plano).deliver!
render json: "Email sent successfully", status: :ok
rescue => e
render json: e.message, status: :bad_request
end
@matiasleidemer
matiasleidemer / gist:1594766
Created January 11, 2012 13:58
PhoneGap Whitelist
<key>ExternalHosts</key>
<array>
<string>localhost</string>
<string>google</string>
</array>
@matiasleidemer
matiasleidemer / gist:1329306
Created October 31, 2011 22:52
Ruby 1.9.2 X Ruby 1.9.3

time bundle exec rake

ruby-1.9.2-p290

  • real 1m28.383s
  • user 1m3.491s
  • sys 0m8.299s

ruby-1.9.3-p0