Skip to content

Instantly share code, notes, and snippets.

View mxmbadev's full-sized avatar

Brandon Espinoza mxmbadev

View GitHub Profile
@sscotth
sscotth / security.json
Created December 12, 2014 21:20
Firebase Security Rules: Grants read/write access to the owner of this user account whose uid must exactly match the key ($uid)
{
"rules": {
"users": {
"$uid": {
".write": "auth !== null && auth.uid === $uid",
".read": "auth !== null && auth.uid === $uid"
}
}
}
}
@sunny
sunny / paperclip_has_destroyable_file.rb
Created October 25, 2012 17:03
Rails Initializer to add destroyable attachments with Paperclip
# encoding: UTF-8
class ActiveRecord::Base
# Class method to add destroyable paperclip attachments.
#
# Example:
# has_attached_file :image
# has_destroyable_file :image
# attr_accessible :image_delete
#