Skip to content

Instantly share code, notes, and snippets.

View craigs's full-sized avatar

Craig Sullivan craigs

View GitHub Profile

Keybase proof

I hereby claim:

  • I am craigs on github.
  • I am craigs0 (https://keybase.io/craigs0) on keybase.
  • I have a public key ASC3y-nEhSPlBBliP_ULEAIaig25p8ForNXYhJnjhiUxOQo

To claim this, I am signing this object:

@craigs
craigs / Placeholder for static images
Created March 27, 2020 03:31
Gist for stackblitz react-message-id-card
// static image in the comments
@craigs
craigs / launch.ly twitter cards snippet
Last active December 19, 2015 06:58
How to implement twitter cards for launch.ly
{% if items.size == 1 %}
{% if item.product? %}
<!-- twitter product card -->
<meta name="twitter:card" content="product">
<meta name="twitter:label1" content="Price">
<meta name="twitter:data1" content="{{ item.variants.first.price | currency_clean }}">
<meta name="twitter:label2" content="{{ item.variants.first.name_a }}">
<meta name="twitter:data2" content="{{ item.variants.first.name_b }}">
{% else %}
@craigs
craigs / chartbeat.js
Created November 4, 2010 08:51
Chart Beat Installation
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
<script type="text/javascript">
var _sf_async_config={uid:12798,domain:"{{ current_account.domain }}"};
(function(){
function loadChartbeat() {
window._sf_endpt=(new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src',
@craigs
craigs / aus_post.rb
Created October 29, 2010 03:15
Australia Post's DRC rate calculator
# Interface to Australia Post's DRC rate calculator
#
# Merchant’s web site must display statements re DRC
# It is a condition of use of the DRC that certain statements are prominently displayed on the Merchant’s web site.
# These statements can be found at web site http://www.edeliver.com.au/Templates/ifs/IFS_DRC_Terms.htm in the section headed "Your representations".
class AusPost
AUSPOST_DRC_URL = "http://drc.edeliver.com.au/ratecalc.asp"
@craigs
craigs / hooks_controller.rb
Created October 21, 2010 22:33 — forked from ryansch/hooks_controller.rb
Chargify Hooks Controller
require 'md5'
class Chargify::HooksController < ApplicationController
protect_from_forgery :except => :dispatch
before_filter :verify, :only => :dispatch
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze
def dispatch
event = params[:event]