Skip to content

Instantly share code, notes, and snippets.

Avatar

Kelly Sutton kellysutton

View GitHub Profile
@kellysutton
kellysutton / Gemfile
Last active Oct 31, 2016
strict-templates-examples
View Gemfile
gem 'strict_templates'
@kellysutton
kellysutton / application.js
Last active Sep 10, 2016
Real-time Recipe for Rails and Ember using Pusher
View application.js
// app/routes/application.js
import Ember from 'ember';
export default Ember.Route.extend({
currentUser: Ember.inject.service(),
pusher: Ember.inject.service(),
activate() {
this._listenToPusherEvents();
},
@kellysutton
kellysutton / generative-utility-colors.sass
Last active Jul 27, 2016
Generating Color Utility Classes in SASS
View generative-utility-colors.sass
$color-list {
red #f00,
green #0f0,
blue #00f
}
@each $value in $color-list {
.#{nth($value, 1)} {
color: nth($value, 2);
}
View exhaustive-markup.html
<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"
/>
@kellysutton
kellysutton / img.html
Created Apr 20, 2016
srcset insanity
View img.html
<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,
View srcset.html
<img
srcset="asset.png,
asset-2x.png 2x,
asset-3x.png 3x"
src="asset.png"
/>
View float-array-to-hex-string.js
requirejs.config({
paths: {
ramda: 'https://cdnjs.cloudflare.com/ajax/libs/ramda/0.13.0/ramda.min'
}
});
require(['ramda'], function (_) {
const trace = _.curry(function(tag, x) {
console.log(tag, x);
return x;
View cleanup.js
import Ember from 'ember';
const { computed, on } = Ember;
// Our Higher Order Function, as before
let has = field => computed.notEmpty(field);
// The Component UI fields as before.
const UI_FIELDS = ['userName', 'password'];
@kellysutton
kellysutton / clean-template.hbs
Last active Aug 29, 2015
Reducing “action cruft” in your Ember templates
View clean-template.hbs
{{post-detail post=post}}
@kellysutton
kellysutton / blog-post
Last active Aug 29, 2015
Public Drafts in Jekyll
View blog-post
---
layout: post
title: "Public Drafts in Jekyll"
date: 2015-02-18 00:00:00
draft: true
---
One of the things I like to do with more…
You can’t perform that action at this time.