Skip to content

Instantly share code, notes, and snippets.

View josemarluedke's full-sized avatar

Josemar Luedke josemarluedke

View GitHub Profile
@josemarluedke
josemarluedke / add_hello.rb
Created March 13, 2012 22:21
Crie o método add_hello que recebe uma classe e define o método hello nessa.
require 'metaid'
class Person
end
def add_hello klass
klass.send :meta_def, :hello, do
"Hello!"
end
end
@josemarluedke
josemarluedke / gist:2348109
Created April 10, 2012 03:09
clear dns on Mac
$ dscacheutil -flushcache
To do the same in 10.7 and 10.8, run this command:
$ sudo killall -HUP mDNSResponder
@josemarluedke
josemarluedke / Gemfile
Created April 26, 2012 23:21
A beautiful Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Database
gem 'pg'
gem "foreigner"
# Improvements
gem 'inherited_resources'
@josemarluedke
josemarluedke / gist:3073407
Created July 8, 2012 23:23
mount partition with fuse-ext2 on OSx
$ fuse-ext2 /dev/disk1s1 /Volumes/test/ -o force
@josemarluedke
josemarluedke / gist:3090936
Created July 11, 2012 14:56
Disable the postgres user from login window [Mac OSX]
$ sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add 'postgres'
$ sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE
@josemarluedke
josemarluedke / gist:3090960
Created July 11, 2012 15:00
Clean up the history of ubuntu 11.+
$ rm /home/USER/.local/share/zeitgeist/activity.sqlite
$ zeitgeist-daemon --replace
@josemarluedke
josemarluedke / slim.vim
Created July 11, 2012 17:02
Vim syntax file [.vim/syntax/slim.vim]
" Vim syntax file
" Language: Slim
" Maintainer: Andrew Stone <[email protected]>
" Version: 1
" Last Change: 2010 Sep 25
" TODO: Feedback is welcomed.
" Quit when a syntax file is already loaded.
if exists("b:current_syntax")
finish
@josemarluedke
josemarluedke / .gitconfig
Created July 11, 2012 17:05
My .gitconfig
[core]
excludesfile = /Users/josemarluedke/.gitignore
[color]
diff = auto
ui = true
[alias]
s = status
ci = commit -m
p = push
[push]
@josemarluedke
josemarluedke / Capfile
Created October 10, 2012 20:17
Capistrano configurations for Rails Application
load 'deploy'
load 'deploy/assets' # Assets pipeline for Rails application
load 'config/deploy'
@josemarluedke
josemarluedke / gist:3868318
Created October 10, 2012 20:47
Install PostgreSQL and create some_user into Postgres
# sudo apt-get install postgresql libpq-dev postgresql-contrib
$ sudo -u postgres createuser some_user
$ cd /etc/init.d/
$ sudo -u postgres psql template1
template1=# ALTER USER some_user WITH PASSWORD 'some_password';
# Edit