Skip to content

Instantly share code, notes, and snippets.

View roccogalluzzo's full-sized avatar
⛑️

Rocco Galluzzo roccogalluzzo

⛑️
View GitHub Profile
@roccogalluzzo
roccogalluzzo / gist:1977777
Created March 5, 2012 10:27 — forked from dhh/gist:1975644
Protect against Mass assigniments bugs
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
'''
prefix_code.py
Copyright 2012-2013 Josiah Carlson
Released under the GNU LGPL v 2.1 license
This module offers the ability to encode/decode a sequence of integers into
strings that can then be used to compare sequences of integers (or paths on
trees) quickly. This module was originally intended to be used in a case-
preserving index in a relational database (where 'Z' comes before 'a', as is
@roccogalluzzo
roccogalluzzo / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@roccogalluzzo
roccogalluzzo / bashrc
Last active August 29, 2015 14:27 — forked from mislav/bashrc
Basic vimrc and tmux config for servers
export PS1="\[\033[38;5;9m\]\h\[$(tput sgr0)\]\[\033[38;5;7m\]@\[$(tput sgr0)\]\[\033[38;5;11m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]\n\\$ >\[$(tput sgr0)\]"
export EDITOR=vim
alias st='git status -sb'
@roccogalluzzo
roccogalluzzo / .rubocop.yml
Last active June 23, 2017 14:52 — forked from joeyates/.rubocop.yml
Cantiere creativo Rubocop Configuration
require: rubocop-rspec
AllCops:
Include:
- "**/*.gemspec"
- "**/*.podspec"
- "**/*.jbuilder"
- "**/*.rake"
- "**/*.opal"
- "**/Gemfile"