Skip to content

Instantly share code, notes, and snippets.

View joelbrewer's full-sized avatar

Joel Brewer joelbrewer

View GitHub Profile
…record/connection_adapters/abstract/
connection_pool.rb: 190:in `block in wait_poll'
…record/connection_adapters/abstract/
connection_pool.rb: 181:in `loop'
…record/connection_adapters/abstract/
connection_pool.rb: 181:in `wait_poll'
…record/connection_adapters/abstract/
connection_pool.rb: 136:in `block in poll'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/
monitor.rb: 211:in `mon_synchronize'
!!!
%html
%head
%meta{:charset => "utf-8"}
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}
%meta{:content => "width=device-width, initial-scale=1", :name => "viewport"}
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
%link{:href => "../../favicon.ico", :rel => "icon"}
%title Brivity
ips.forEach(function(ip) {
var url = "/p/ip?ip=" + ip + "&days=" + days;
get_json_calls.push(
$.getJSON(url, function(data) {
data.push(data);
})
);
});
$.when.apply(null, get_json_calls).done(function() {
.rounded {
border-radius: 15px;
}
<%= image_tag("header.jpg", class: "rounded") %>
#! /usr/bin/env ruby
require 'pg'
require 'resolv'
# This script is used to query score.senderscore.com for senderscores
# Given an array of IPs the script will query for their sender scores
# and save the info to a database
#
# Author: Joel Brewer ([email protected])
@joelbrewer
joelbrewer / gist:59199421f5f2a3bb2ea2
Created September 16, 2014 23:47
A copy of Shop has been removed from the module tree but is still active
ArgumentError - A copy of Shop has been removed from the module tree but is still active!:
activesupport (4.1.4) lib/active_support/dependencies.rb:465:in `load_missing_constant'
activesupport (4.1.4) lib/active_support/dependencies.rb:180:in `const_missing'
() Users/joelbrewer/Development/Repos/echome/app/models/shop.rb:9:in `retrieve'
shopify_app (5.0.0) lib/shopify_app/shopify_session_repository.rb:10:in `retrieve'
() Users/joelbrewer/Development/Repos/echome/app/controllers/surveys_controller.rb:4:in `index'
actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
def subscribe
merchant = Merchant.find(params[:merchant_id])
mailchimp = Mailchimp::API.new(merchant.mailchimp_api_key)
mailchimp_response = mailchimp.lists.subscribe(merchant.mailchimp_list_id, :email => params[:email])
end
m.instagram_username
=> false
irb(main):019:0> m.instagram_username = "joel"
=> "joel"
irb(main):020:0> m.save
=> true
irb(main):021:0> m.instagram_username
=> false
irb(main):022:0> m
=> #<Merchant id: 1, domain: "echome-3.myshopify.com", created_at: "2014-09-01 23:35:28", updated_at: "2014-09-12 18:11:58", coupon_code: "great_offer!", instagram_username: false, facebook_share_link: "brewerdigital.com", enable_facebook: true, enable_instagram: false, instagram_full_name: "Hello", instagram_profile_picture: nil, instagram_id: "1354399585", facebook_share_text: "Brewer digital provides excellent services for a g...", widget_message: "Save 10% on your current order!">
%section.form
= form_for @project do |f|
.title
= f.label :title
= f.text_field :title
.date
= f.label "Start Date"
.month.inline= f.select(:month, ('01'..'12').to_a)
.day.inline= f.select(:day, ('01'..'31').to_a)
.year.inline= f.select(:year, ((Time.now.year)..Time.now.year + 5).to_a)
SELECT date_trunc('day', to_timestamp(injtime_first)) AS "Day" , sum(total_success) AS "Successfully Sent"
FROM sends
WHERE to_timestamp(injtime_first) > now() - interval '1 month'
GROUP BY 1
ORDER BY 1;