Skip to content

Instantly share code, notes, and snippets.

@derrickreimer
derrickreimer / sendgrid_api_scopes.yml
Last active March 29, 2017 17:25
All available SendGrid API scopes
# Current as of March 31, 2016
#
# There is an incomplete list of permissions in the docs:
# https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html
#
# The rest have been filled in from the scopes endpoint:
# https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_keys_permissions.html
# Alerts
- alerts.create # create new alerts
@derrickreimer
derrickreimer / credit_card_form.js.coffee
Created February 25, 2015 22:47
Credit card flight components
define (require) ->
defineComponent = require("flight/lib/component")
withCreditCardForm = require("app/mixins/with_credit_card_form")
withErrors = require("app/mixins/with_errors")
CreditCardFormUI = ->
@attributes
submitSelector: "input[type='submit']"
@submit = ->
- I wrote this on the train after a long day with a heavy head cold. I haven't run it,
but regardless of likely errors I think it expresses the design well enough.
- Segment and ConditionSet look close to identical, but that's likely due to the simplified
nature of the outline you provided
- I don't like attaching components to classes unless they're `js-`, as it's coupling
your styling and behaviour layers. We excelusively use data attributes for JS-DOM coupling
and I've quickly grown fond of the approach.
@derrickreimer
derrickreimer / nested-ui.html
Last active August 29, 2015 13:59
Flight.js + Nested DOM UI
<!--
The data model is as follows:
- A "segment" has many "condition sets"
- A "condition set" has many "conditions"
- A "condition" has a number of attributes
-->
<div class="segment">
<ul class="condition-sets">
<li>
@derrickreimer
derrickreimer / webhooks.json
Last active December 24, 2015 10:29
Drip - Subscriber Webhooks
{
"event": "subscriber.subscribed",
"data": {
"object": {
"id": 99999,
"email": "foo@bar.com",
"fields": {
"first_name": "John",
"last_name": "Doe"
},
@derrickreimer
derrickreimer / mixins.scss
Created May 29, 2013 16:36
Common mixins
@mixin gradient($from, $to) {
background: $from; // Old browsers
background: -moz-linear-gradient(top, $from 0%, $to 100%); // FF3.6+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$from), color-stop(100%,$to)); // Chrome,Safari4+
background: -webkit-linear-gradient(top, $from 0%,$to 100%); // Chrome10+,Safari5.1+
background: -o-linear-gradient(top, $from 0%,$to 100%); // Opera 11.10+
background: -ms-linear-gradient(top, $from 0%,$to 100%); // IE10+
background: linear-gradient(to bottom, $from 0%,$to 100%); // W3C
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$from', endColorstr='#ffffff',GradientType=0 ); // IE6-9
}
@derrickreimer
derrickreimer / mailgun-1.rb
Created April 15, 2013 15:23
Custom variables for Mailgun
# Attempt 1:
# Send variables using v:[my variable]
api_key = "key-zxy" # my key
api_url = "https://api.mailgun.net/v2/drip.mailgun.org"
# Using the Faraday gem
connection = Faraday.new(:url => api_url) do |builder|
builder.request :url_encoded
builder.response :json, :content_type => /\bjson$/
@derrickreimer
derrickreimer / db.rake
Created July 14, 2012 20:43 — forked from xaviershay/db.rake
db:structure:load for Rails 3.1
# Adapter from http://pivotallabs.com/users/jdean/blog/articles/1707-using-mysql-foreign-keys-procedures-and-triggers-with-rails
namespace :db do
namespace :structure do |schema|
schema[:dump].abandon
desc "OVERWRITTEN - shell out to mysqldump"
task :dump => :environment do
cmd = "mysqldump #{mysql_options} -d --routines --triggers --skip-comments > db/development_structure.sql"
system cmd
File.open("#{Rails.root}/db/#{Rails.env}_structure.sql", "a") { |f| f << ActiveRecord::Base.connection.dump_schema_information }
end
@derrickreimer
derrickreimer / rbenv-install-system-wide.sh
Created January 15, 2012 17:17
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@derrickreimer
derrickreimer / gist:1238645
Created September 23, 2011 22:40
Regex Pattern
Some text here.
Some more text here.
- First sentence.
- Second sentence.
- Third sentence.
More lines.
Some more lines.