Skip to content

Instantly share code, notes, and snippets.

View joelbrewer's full-sized avatar

Joel Brewer joelbrewer

View GitHub Profile
@joelbrewer
joelbrewer / gist:77dde6470cd6c3160166
Created September 8, 2014 00:58
api return format
a:27:{s:7:"success";i:1;s:6:"status";s:9:"completed";s:11:"recips_sent";i:303437;s:12:"recips_total";i:303437;s:24:"recips_total_is_estimate";i:0;s:13:"starttime_sec";s:10:"1373382019";s:13:"starttime_str";s:21:"2013-07-09 T 10:00:19";s:14:"finishtime_sec";s:10:"1373386740";s:14:"finishtime_str";s:21:"2013-07-09 T 11:19:00";s:15:"num_recips_html";s:6:"303437";s:15:"num_recips_text";s:1:"0";s:20:"num_recips_multipart";s:1:"0";s:16:"num_bounces_hard";s:3:"185";s:16:"num_bounces_soft";s:5:"13317";s:17:"num_bounces_other";s:5:"82329";s:10:"num_unsubs";s:2:"45";s:9:"num_opens";s:3:"855";s:16:"num_opens_unique";s:3:"614";s:10:"num_clicks";s:3:"129";s:5:"links";a:11:{i:0;a:3:{s:3:"url";s:60:"https://itunes.apple.com/us/app/gotomeeting/id424104128?mt=8";s:12:"total_clicks";s:1:"7";s:13:"unique_clicks";s:1:"1";}i:1;a:3:{s:3:"url";s:82:"https://play.google.com/store/apps/details?id=com.citrixonline.android.gotomeeting";s:12:"total_clicks";s:1:"6";s:13:"unique_clicks";s:1:"1";}i:2;a:3:{s:3:"url";s:34:"https://twitter.co
def load_instagram(object)
object_method = self.method("instagram_#{object}")
if object_method.call != nil
object_method.call
elsif instagram_username.nil? || instagram_username.empty?
""
else
user = Instagram.user_search(instagram_username, {:count => 1})
if user.empty?
""
ActiveRecord::RecordInvalid at /merchants/2
Validation failed: Facebook username can't be blank
<!DOCTYPE html>
<html lang="en">
<head>
<title>Shopify Demo App</title>
<script src="//cdn.shopify.com/s/assets/external/app.js"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: '<%= ShopifyApp.configuration.api_key %>',
shopOrigin: '<%= "https://#{ Shop.retrieve(session[:shopify]).url }" if Shop.retrieve(session[:shopify]) %>'
});
url -I 'https://glacial-tor-6718.herokuapp.com/login?shop=echome-3.myshopify.com&timestamp=1409085968&signature=bfe377f0b547f67788dea2ec13e6d677'\;
HTTP/1.1 200 OK
Connection: keep-alive
X-Frame-Options: ALLOWALL
Content-Type: text/html; charset=utf-8
Etag: "706e3afa449d598d01d856563ee98eb4"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b440c382-80e4-4aac-ac2c-885b22b4ef78
X-Runtime: 0.009061
Server: WEBrick/1.3.1 (Ruby/2.0.0/2014-05-08)
@joelbrewer
joelbrewer / gist:b73a0b0ee9632edd8e09
Created August 26, 2014 20:02
Refuse to frame error
[Report Only] Refused to frame 'http://localhost:3000/login?shop=echome-3.myshopify.com&timestamp=1409082689&signature=aa3841517f2c389959c40fdd1b88d596' because it violates the following Content Security Policy directive: "frame-src 'self' https: safari-extension: chrome-extension-resource: chrome-extension: chromeinvoke: chromeinvokeimmediate: webviewprogressproxy: webkit-fake-url: chromenull: data:".
echome-3.myshopify.com/admin/apps/c6928d57bc0f94a78d79d38fb0446538:1
The page at 'https://echome-3.myshopify.com/admin/apps/c6928d57bc0f94a78d79d38fb0446538' was loaded over HTTPS, but ran insecure content from 'http://localhost:3000/login?shop=echome-3.myshopify.com&timestamp=1409082689&signature=aa3841517f2c389959c40fdd1b88d596': this content should also be loaded over HTTPS.
echome-3.myshopify.com/admin/apps/c6928d57bc0f94a78d79d38fb0446538:1
Refused to display 'http://localhost:3000/login?shop=echome-3.myshopify.com&timestamp=1409082689&signature=aa3841517f2c389959c40fdd1b88d596' in a frame because it set
ShopifyAPI::Base.activate_session(sess)
ss = ShopifyAPI::ScriptTag.find(:all, :params => {:src => "https://s3.amazonaws.com/echome/app.js"})
ss ||= ShopifyAPI::ScriptTag.create({:src => "https://s3.amazonaws.com/echome/app.js", :event => 'onload'})
SELECT
sends_lists.listid,
max(case when month=1 then total_messages end) as "Total Jan",
max(case when month=2 then total_messages end) as "Total Feb",
max(case when month=3 then total_messages end) as "Total Mar",
max(case when month=4 then total_messages end) as "Total Apr",
max(case when month=5 then total_messages end) as "Total May",
max(case when month=6 then total_messages end) as "Total Jun",
max(case when month=7 then total_messages end) as "Total Jul",
max(case when month=8 then total_messages end) as "Total Aug",
@joelbrewer
joelbrewer / gist:282a2cc02db3337e391b
Created August 21, 2014 14:57
hvmail_postgres_manager
#!/bin/bash
# chkconfig: 3 99 01
# description: Script to stop, start, and restart GreenArrow Engine's PostgreSQL server, along with the services that depend on it.
start() {
echo "Starting PostgreSQL..."
/usr/local/bin/svc -u /service/hvmail-postgres
sleep 5
echo "...done."
[root@proliant.netcontentinc.net bin]# grep hvmail /etc/rc.d/init.d/*
/etc/rc.d/init.d/hvmail:# hvmail Starts and stops HVMail, a high volume mail transfer agent.
/etc/rc.d/init.d/hvmail: action "Starting HVMail:" /var/hvmail/bin/hvmail_init start
/etc/rc.d/init.d/hvmail: [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hvmail
/etc/rc.d/init.d/hvmail: action "Stopping HVMail (this may take some time):" /var/hvmail/bin/hvmail_init stop
/etc/rc.d/init.d/hvmail: rm -f /var/lock/subsys/hvmail
/etc/rc.d/init.d/hvmail: /var/hvmail/bin/hvmail_init status
/etc/rc.d/init.d/hvmail_studio3: echo "UPDATE ss_jobs SET jobstatus = 'w', paused_for_maintenance = FALSE WHERE jobstatus = 'p' AND paused_for_maintenance IS TRUE" | /var/hvmail/postgres/8.3/bin/psql -U greenarrow greenarrow
/etc/rc.d/init.d/hvmail_studio3: echo "UPDATE ss_jobs SET jobstatus = 'p', paused_for_maintenance = TRUE WHERE jobstatus = 'i' AND paused_for_maintenance IS NOT TRUE" | /var/hvmail/postgres/8.3/bin/psql -U greenarrow greenarrow