This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /documents/:id(/:version)(.:format) {:action=>"show", :controller=>"documents"} | |
GET /documents/:id(/:version)/edit(.:format) {:action=>"edit", :controller=>"documents"} | |
PUT /documents/:id(/:version)(.:format) {:action=>"update", :controller=>"documents"} | |
DELETE /documents/:id(/:version)(.:format) {:action=>"destroy", :controller=>"documents"} | |
GET /documents/:document_id(/:version)/sections(.:format) {:action=>"index", :controller=>"sections"} | |
POST /documents/:document_id(/:version)/sections(.:format) {:action=>"create", :controller=>"sections"} | |
GET /documents/:document_id(/:version)/sections/new(.:format) {:action=>"new", :controller=>"sections"} | |
GET /documents/:document_id(/:version)/sections/:id/edit(.:format) {:action=>"edit", :controller=>"sections"} | |
GET /documents/:document_id(/:version)/sections/:id(.:format) {:action=>"show", :controller=>"section |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some text here. | |
Some more text here. | |
- First sentence. | |
- Second sentence. | |
- Third sentence. | |
More lines. | |
Some more lines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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$/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"event": "subscriber.subscribed", | |
"data": { | |
"object": { | |
"id": 99999, | |
"email": "[email protected]", | |
"fields": { | |
"first_name": "John", | |
"last_name": "Doe" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = -> |
OlderNewer