Skip to content

Instantly share code, notes, and snippets.

View elland's full-sized avatar
🎄

Igor Ranieri Elland elland

🎄
View GitHub Profile
@rafaelp
rafaelp / attr_acessible_security.rb
Created March 5, 2012 03:59
How to protect against mass assignment attack
# Put this file on config/initializer
# This will create an empty whitelist of attributes available for mass assignment for
# all models in your app. As such, your models will need to explicitly whitelist
# accessible parameters by using an attr_accessible declaration. This technique is best
# applied at the start of a new project. However, for an existing project with a thorough
# set of functional tests, it should be straightforward and relatively quick to insert this
# initializer, run your tests, and expose each attribute (via attr_accessible) as dictated
# by your failing tests.
@Gabriella439
Gabriella439 / shell.nix
Created February 10, 2022 16:27
nix-shell for GHC development
# This was only tested against revision ac2d18a7353cd3ac1ba4b5993f2776fe0c5eedc9
# of https://gitlab.haskell.org/ghc/ghc
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/7e003d7fb9eff8ecb84405360c75c716cdd1f79f.tar.gz";
sha256 = "08y8pmz7xa58mrk52nafgnnrryxsmya9qaab3nccg18jifs5gyal";
};
config.allowBroken = true;
@adisbladis
adisbladis / env1-shell.nix
Created July 17, 2019 11:53
Merge multilple shell.nix files using mkShell
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.hello
];
shellHook = ''
echo env1
'';