Skip to content

Instantly share code, notes, and snippets.

View IncrementerContainerClass.jsx
import React, {Component} from 'react';
import IncrementerPresenter from './IncrementerPresenter';
export default class IncrementerContainer extends Component {
this.state = {count: 0};
this.increment = this.increment.bind(this)
this.setState((currState) => ({count: currState.count + 1}));
igorbenic / allowedBlocks.js
Last active Apr 30, 2020
How to enable Inner Blocks in your Gutenberg Block |
View allowedBlocks.js
<InnerBlocks allowedBlocks={ [ 'core/image', 'core/paragraph' ] } />
srilankanchurro / LetsEncrypt_HTTPS_plex.MD
Last active Jul 1, 2020
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
View LetsEncrypt_HTTPS_plex.MD
BrianSipple /
Last active Apr 17, 2017
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

datchley / app.js
Last active Nov 4, 2018
"Getting Functional with Javascript" Blog post source files
View app.js
* Primary application logic for our Functional Programming blog example
* See related blog series at:
* Version: 2.0
// A simple, resuable comparison for '>='
function greaterThanOrEqual(a, b) {
return a >= b
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
jamesarosen /
Last active Oct 9, 2016
Ember-Data Relationships and Legacy APIs

This post is one in a series on converting a Backbone app to Ember. See also Ember-Data Notes.

Recently, our team has been trying to get Ember-Data to work with an API that does not conform to the json:api standard. The experience has been mostly good, but we've really struggled with the relationships. We have a Customer model that has many pastInvoices and a single monthToDateInvoice. The URL for past invoices is /billing/invoice?explicit_customer_id={{customerId}}; for month-to-date, it's /billing?no_list=true&explicit_customer_id={{customerId}}. The JSON that the API returns for a customer does not include any link to those URLs.

First Attempt: InvoiceAdapter

Our first attempt was to create an InvoiceAdapter that understood how to fetch invoices from those URLs:

// app/billing/invoices/adapter.js:
runspired / touchZone.styl
Last active Mar 7, 2018
On mobile, sometimes it's necessary to provide an invisible larger area to recognize touch inputs on a crucial or otherwise difficult to activate button. This is an example of one way of doing so using pseudo elements. In this particular implementation, the buttons this was being added to would shrink while active, so a countering scaling effect…
View touchZone.styl
content ' '
display block
width 100%
height 100%
z-index 100
top 0
position absolute
View initializer-session.js
/* Original source:
* Modified fork:
* Working authentication with
* Firebase 2.0.x + Ember.js 1.8.1 + Ember Data Canary + EmberFire 1.3.0 + Ember CLI
* works for me!
* Note: this assumes you've set up login on your Firebase,
* only handles Google and Facebook for now.
View spread.sass
// strip-units required by spread mixin
@function strip-units($number)
@return $number / ($number * 0 + 1)
// pow and sqrt required by ease function
// adapted from
@function pow($base, $exponent)
$value: $base
You can’t perform that action at this time.