Skip to content

Instantly share code, notes, and snippets.

View ryanmarshall's full-sized avatar

Marshall ryanmarshall

View GitHub Profile
Rollbar.configure do |config|
# Without configuration, Rollbar is enabled in all environments.
# To disable in specific environments, set config.enabled=false.
config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] || Rails.application.secrets.rollbar_access_token
# Here we'll disable in 'test' and 'dev':
if Rails.env.test? or Rails.env.development?
config.enabled = false
end
{
"statusCode" => 400,
"issues" => [
[ 0] {
"code" => "invalid_type",
"path" => "items[0][type]",
"message" => "String value required",
"spec" => {
"type" => "String",
"description" => "The type of product this design is for",
{
"items" => [
[0] {
"type" => "dtg",
"designId" => "5e87e09cd7a911160144e150",
"products" => [
[0] {
"id" => "gildan-cotton-t-shirt",
"color" => "Black",
"quantity" => 2,
@ryanmarshall
ryanmarshall / hex_color.rb
Last active May 12, 2017 04:18
This helper class will find the closest hex color from an array of hex colors
# By: Ryan Marshall
#
# This helper class will find the closes hex color from an array of other hex colors
#
#
# colors = ["e00928","24519b","461b00", "dae12a", "ff9c3e",]
# color = "285fa2"
#
class HexColor
var Generator = function(options) {
this.init = function() {
console.log('init')
this.runSomeSetup();
};
this.runSomeSetup = function() {
console.log('setup');
}
var Generator = {
loaded: false,
init: function(e) {
if (this.loaded == false) {
this.loaded = true;
this.setup();
}
},
setup: function() {
console.log('setup');
@ryanmarshall
ryanmarshall / gist:989900
Created May 24, 2011 22:29
Quick Ruby Signed Request Parser for Facebook
module Facebook
#
# Facebook request tools
#
class Request
class << self
def parse_signed_request(signed_request, secret, max_age=3600)
encoded_sig, encoded_envelope = signed_request.split('.', 2)
envelope = JSON.parse(base64_url_decode(encoded_envelope))
algorithm = envelope['algorithm']
class Whatever < ActiveRecord::Base
#field name is 'name'
def foo
name
self['name']
self.name
end
end
Panasonic
Canon
Sony
Nikon
Kodak
Fujifilm
Pentax
Olympus
Digital
NIKON
Silver
Blue
Red
Black
Pink
Green
Plum
Champagne Silver
Brown
Orange