Skip to content

Instantly share code, notes, and snippets.

View serradura's full-sized avatar
🎯
Focusing

Rodrigo Serradura serradura

🎯
Focusing
View GitHub Profile
@serradura
serradura / in_memory.rb
Created July 24, 2020 18:36 — forked from fernandes/in_memory.rb
AR in memory
require "active_record"
require "sqlite3"
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:host => "localhost",
:database => ':memory:'
)
ActiveRecord::Schema.define do
@serradura
serradura / admin-product.rb
Created December 23, 2016 00:32 — forked from ottodranik/admin-product.rb
Example: Use Acts-As-Taggable-On gem with Active-Admin and rails observers
ActiveAdmin.register Product do
permit_params :name, :category_id, :description, :text, :slug, :in_slider, :tag_ids => []
filter :category
filter :base_tags
filter :name
filter :text
filter :created_at
filter :updated_at
/*************
CONSTRUCTOR:
*************
Notify.options = {"closeButton": true}; // Defines global options.
notify = new Notify({"closeButton": false}); // You can pass custom options
*/
/*******
USAGE
*******
@serradura
serradura / fgraph.rb
Last active December 10, 2015 00:58 — forked from anonymous/fb_public.rb
Two clients: HGet (easy way to have Net::HTTP responses supports HTTP and HTTPS) and FGraph (shortcut to do Facebook Graph API requests)
# Examples:
# client = FGraph.new("USERNAME")
#
# if you need see response details use:
# client.request # returns a Net::HTTPFound instance, with this you can see the status, headers# Examples:
# client = FGraph.new("USERNAME")
#
# client.data # returns the parsed response body
# if you need an alias to get the api data response, use:
@serradura
serradura / LICENSE.txt
Created April 27, 2012 17:10 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Rodrigo Serradura <http://github.com/serradura>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.