Skip to content

Instantly share code, notes, and snippets.

View rdela's full-sized avatar
🐞
Various bug fixes and improvements

Ricky de Laveaga rdela

🐞
Various bug fixes and improvements
View GitHub Profile

Proposal for Improving Mass Assignment

For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.

Sign Allowed Fields

When creating a form with form_for, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.

To allow new known fields to be added via JS, we could add:

@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@dan
dan / hack.sh
Created March 31, 2012 12:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cowboy
cowboy / runme.sh
Created April 5, 2012 21:43
Linkify every H2+ in *.md MarkDown files with a ⚑ for GitHub-friendly deep-linking.
ruby -pi -e '$_.gsub!(/(##+)\s+(.*?)\s*\n/){a,b=$1,$2;name=b.downcase.gsub(/\W+/,"-").gsub(/^-|-$/,"");%{#{a} #{b} <a name="#{name}" href="##{name}" title="Link to this section">⚑</a>\n}}' *.md
@cameronmcefee
cameronmcefee / gist:2641743
Created May 9, 2012 04:14
Font Configuration File
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["ttf","woff","eot","svg"],"tt_instructor":"default","options_subset":"advanced","subset_custom":"","subset_custom_range":"f000-f073,f200-f273","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
@paulirish
paulirish / gist:3098860
Created July 12, 2012 15:26
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as a starting point for discussion between speaker and organizer. They are not a list of demands; they are a list of rea

@rmurphey
rmurphey / gist:3105199
Created July 13, 2012 14:30 — forked from paulirish/gist:3098860
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. It was prepared by three experienced conference speakers -- one of whom has also organized conferences -- and influenced by many others. Its goal is to let speakers know what they might reasonably expect from a conference, in exchange for the hours we expect them to spend researching, preparing, and rehearsing, and the time they will spend away from home and family.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves.

These expectations should serve as *a starting point for discussion between sp

Hey. So, we're writing because we're people who spend a lot of time in #jquery helping others -- people like you who are trying to get their bearings with jQuery or JavaScript or who are maybe struggling through some problem that's got them particularly stumped.

We've noticed that you've been kind of, well, dominating the channel a lot lately -- sort of like you're talking through every problem you're running into while you're working on your app, and sometimes repeating your inquiries when you don't get a response. We want to be helpful, we really do, but the constant stream of questions is ... well, it's led to a lot of us just tuning you out, and that's probably not what you want.

So: our biggest request is that you show a little more effort at working through your problems on your own, rather than announcing them in the channel shortly after you encounter them. Below are a few other suggestions; some are based on our experience, while others are from the excellent post about [help vampires](http://sla

@lisamelton
lisamelton / encode.sh
Last active March 31, 2024 21:13
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.
@lisamelton
lisamelton / batch.sh
Last active December 18, 2015 05:59
Batch control for the "transcode-video.sh" script.
#!/bin/bash
# batch.sh
#
# Copyright (c) 2013-2014 Don Melton
#
# This version published on October 22, 2014.
#
# Batch control for the "transcode-video.sh" script.
#