This file contains 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
curl -v \ | |
-o /dev/null \ | |
"https://layervault-preview.imgix.net/remote_preview_data/436751/original/.1366399179.726358.preview_Front_Page.psd20130419-9702-55ihns.png?fit=max&w=620&dpr=2&s=f1a5c768644356087baf28d5cabf9c74" | |
---- 200: Request includes CORS headers ---- | |
curl -i \ | |
-H "If-Modified-Since:Fri, 19 Apr 2013 19:19:49 GMT" \ | |
"https://layervault-preview.imgix.net/remote_preview_data/436751/original/.1366399179.726358.preview_Front_Page.psd20130419-9702-55ihns.png?fit=max&w=620&dpr=2&s=f1a5c768644356087baf28d5cabf9c74" |
This file contains 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
<img srcset="https://assets.imgix.net/flower.jpg?w=50 50w, | |
https://assets.imgix.net/flower.jpg?w=100 100w, | |
https://assets.imgix.net/flower.jpg?w=150 150w, | |
https://assets.imgix.net/flower.jpg?w=200 200w, | |
https://assets.imgix.net/flower.jpg?w=250 250w, | |
https://assets.imgix.net/flower.jpg?w=300 300w, | |
https://assets.imgix.net/flower.jpg?w=350 350w, | |
https://assets.imgix.net/flower.jpg?w=400 400w, | |
https://assets.imgix.net/flower.jpg?w=450 450w, | |
https://assets.imgix.net/flower.jpg?w=500 500w, |
This file contains 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
<img srcset="https://assets.imgix.net/flower.jpg?w=50 50w, | |
https://assets.imgix.net/flower.jpg?w=100 100w, | |
https://assets.imgix.net/flower.jpg?w=150 150w, | |
... | |
https://assets.imgix.net/flower.jpg?w=5200 5200w, | |
https://assets.imgix.net/flower.jpg?w=5260 5260w" | |
src="https://assets.imgix.net/flower.jpg?w=540" | |
alt="A white flower" | |
/> |
This file contains 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
$color-list { | |
red #f00, | |
green #0f0, | |
blue #00f | |
} | |
@each $value in $color-list { | |
.#{nth($value, 1)} { | |
color: nth($value, 2); | |
} |
This file contains 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
// app/routes/application.js | |
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
currentUser: Ember.inject.service(), | |
pusher: Ember.inject.service(), | |
activate() { | |
this._listenToPusherEvents(); | |
}, |
This file contains 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
gem 'strict_templates' |
This file contains 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
POST /graphql | |
Content-Type: application/graphql | |
{ | |
post(id: 1) { | |
id | |
title | |
comments { | |
id | |
body | |
} |
This file contains 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
class TaxCalculationSaver | |
def self.save_taxes!(payroll) | |
total_tax_amount = payroll.employees.map do |employee| | |
TaxCalculator.calculate(payroll, employee) | |
end.sum | |
PayrollSaver.save!(payroll, total_tax_amount: total_tax_amount) | |
end | |
end |
This file contains 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
class PayrollRunner | |
def run! | |
TaxEngineWrapper.new(tax_engine).apply(commands) | |
computed_taxes = tax_engine.calculate_taxes | |
payroll.assign_taxes(computed_taxes) | |
end | |
# This is now a pure function from the view of its callers. | |
# Sweet! | |
def commands |
This file contains 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
RSpec.describe User do | |
describe '#full_name' do | |
subject do | |
described_class.new(first_name, middle_name, last_name) | |
end | |
let(:first_name) { 'Roy' } | |
let(:last_name) { 'Biv' } | |
context 'middle name is given' do | |
let(:middle_name) { 'Gee' } |