Skip to content

Instantly share code, notes, and snippets.

@hundredwatt
hundredwatt / store_bug_test.rb
Last active January 4, 2016 19:30
ActiveRecord::Store - no implicit conversion of ActiveSupport::HashWithIndifferentAccess into String
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.0.2'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
1. To start the OAuth Flow, send the user to:
https://accounts.gaggleamp.com/oauth/authorize?
client_id=%CLIENT_ID%&
redirect_uri=%REDIRECT_URI%&
response_type=code
Where `%CLIENT_ID%` is your applications consumer key and `%REDIRECT_URI%` is the location the redirect location for your application.
2. After completing the OAuth flow successfully, the user will be redirected back to your application with a short-lived verification code:
{
"message": {
"id": 79918,
"message_text": "Check out this workshop on #socialmedia for #nonprofits - June 4 @UnitedWay quarters - http://gag.gl/o7MDl ",
"gaggle_id": 31,
"target_network": "twitter",
"posts_at": 1369745509,
"expires_at": 1370317500,
"created_at": 1369745484,
"updated_at": 1369745488,
{
"gaggles": [
{
"id": 2,
"name": "Test",
"invitation_page_url": "https://gaggleamp.com/EzlKlH2",
"logo_urls": {
"small": "https://s3.amazonaws.com/gaggleamp-stage/organization_logos/2/small/GaggleAMP.png",
"thumb": "https://s3.amazonaws.com/gaggleamp-stage/organization_logos/2/thumb/GaggleAMP.png"
}
@hundredwatt
hundredwatt / ec2_ip.rb
Created April 22, 2012 16:12
Function for detecting if an IP address is from EC2
# Ranges Source: https://forums.aws.amazon.com/ann.jspa?annID=1408
# Ranges up-to-date as of: March 20, 2012
EC2_IP_RANGES = %w(
103.4.8.0/21 (103.4.8.0 - 103.4.15.255)
107.20.0.0/14 (107.20.0.0 - 107.23.255.255)
122.248.192.0/18 (122.248.192.0 - 122.248.255.255)
174.129.0.0/16 (174.129.0.0 - 174.129.255.255)
175.41.128.0/18 (175.41.128.0 - 175.41.191.255)
175.41.192.0/18 (175.41.192.0 - 175.41.255.255)
176.32.64.0/19 (176.32.64.0 - 176.32.95.255)
@hundredwatt
hundredwatt / mass_assignment_security_generator.rb
Created March 4, 2012 22:34
Mass Assignment Security Generator
# Copyright (C) 2012 Jason Nochlin
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
@hundredwatt
hundredwatt / .vimrc
Created October 6, 2011 18:34
Jason's VimRC
"Replace tabs with 2 spaces
set expandtab
set softtabstop=2
set shiftwidth=2
set tabstop=2
"Move all swap files to .vim/temp
set backupdir=~/.vim/temp
set directory=~/.vim/temp
<object width="420" height="315" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">
<param name="movie" value="/YTPlayer.swf?vidId=UF8uR6Z6KLc" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<embed src="/YTPlayer.swf?vidId=UF8uR6Z6KLc" type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="420" height="315"></embed>
</object>