Skip to content

Instantly share code, notes, and snippets.

View josemarluedke's full-sized avatar

Josemar Luedke josemarluedke

View GitHub Profile
@josemarluedke
josemarluedke / gist:3868331
Created October 10, 2012 20:50
Nginx configuration for passenger and capistrano
# Edit the file:
vim /opt/nginx/conf/nginx.conf
server {
listen 80;
server_name www.example.com;
location / {
root /home/deploy/www/application/current/public;
passenger_enabled on;
rails_env production;
@josemarluedke
josemarluedke / server.md
Created October 12, 2012 01:42
Ubuntu with Nginx + Ruby 1.9.3 + PostgreSQL 9.1 + Passenger + Papistrano

Ubuntu with Nginx + Ruby 1.9.3 + PostgreSQL 9.1 + Passenger + Papistrano

Update the system

sudo apt-get update

Install some dependencies

@josemarluedke
josemarluedke / gist:3889323
Created October 14, 2012 17:51
Dear friend - Texts
Dear friend,
Everybody loves beautiful handwritten letters. Here you can write a message to someone special and support a community. They will transcript it for you, with a personal touch. Your letter will be sent, in the real world.
P.S.: The best part: the money goes to the community! :)
Dear friend,
@josemarluedke
josemarluedke / gist:4966963
Created February 16, 2013 13:36
Assets precompile with subdirectory
RAILS_RELATIVE_URL_ROOT=new_site RAILS_ENV=production rake assets:precompile
@josemarluedke
josemarluedke / inherited_resources.rb
Created February 27, 2013 03:40
MonkeyPatch for Inherited Resources to works with strong parameters and rails 4.0
# MonkeyPatch for Inherited Resources to works with strong parameters and rails 4.0
module InheritedResources
module BaseHelpers
protected
def build_resource
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, request.get? ? {} : resource_params))
end
def update_resource(object, attributes)
object.update_attributes(attributes)
@josemarluedke
josemarluedke / devise.pt-br.yml
Last active December 14, 2015 19:09
Translations for devise views used in github.com/josemarluedke/rails-template/
# Devise Views
pt-BR:
devise:
registrations:
edit:
provider: "Provedor"
connect_disconnect: "Conectar/Desconectar"
unhappy: "Infeliz?"
cancel_my_account: "Cancelar a minha conta"
edit_devise_resource: "Editar %{resource_name}"
#= require_self
#= require_tree .
window.Tasker =
Common:
initPage: ->
# If you're using the Turbolinks and you need run a code only one time, put something here.
# if you're not using the turbolinks, there's no difference between init and initPage.
# toggle links
Tasker.Projects = {} if Tasker.Projects is undefined
Tasker.Projects.Show = ->
$('.new-task-button').click ->
url = $(this).data('url')
$.ajax
url: url
type: "GET"
success: (data)->
$('#newTask .modal-body').html(data)
@josemarluedke
josemarluedke / .vimrc.local
Last active December 16, 2015 18:09
.vimrc.local
if has("gui_running")
color peacock
else
color railscasts
endif
@josemarluedke
josemarluedke / post-commit
Created May 7, 2013 20:22
Git hook for taking picture on commit
#!/usr/bin/env ruby
file="~/Drive/.gitshots/#{Time.now.to_i}.jpg"
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__))
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file} &"
end
exit