Skip to content

Instantly share code, notes, and snippets.

Sean Goresht srsgores

Block or report user

Report or block srsgores

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View IncrementerContainerClass.jsx
import React, {Component} from 'react';
import IncrementerPresenter from './IncrementerPresenter';
export default class IncrementerContainer extends Component {
constructor(props){
super(props);
this.state = {count: 0};
this.increment = this.increment.bind(this)
}
increment(){
this.setState((currState) => ({count: currState.count + 1}));
@igorbenic
igorbenic / allowedBlocks.js
Last active Aug 13, 2019
How to enable Inner Blocks in your Gutenberg Block | https://ibenic.com/enable-inner-blocks-gutenberg
View allowedBlocks.js
<InnerBlocks allowedBlocks={ [ 'core/image', 'core/paragraph' ] } />
@srilankanchurro
srilankanchurro / LetsEncrypt_HTTPS_plex.MD
Last active Sep 17, 2019
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
View LetsEncrypt_HTTPS_plex.MD
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active Apr 17, 2017
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons
View ember-addon-essentials.md

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
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: http://www.datchley.name/tag/functional-programming/
* 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
jamesarosen / ember-data-notes.md
Last active Oct 9, 2016
Ember-Data Relationships and Legacy APIs
View ember-data-notes.md

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
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
.touchZone::after
content ' '
display block
width 100%
height 100%
z-index 100
top 0
position absolute
View initializer-session.js
/* Original source: https://gist.github.com/oskarrough/914653b03d886c015320
* Modified fork: https://gist.github.com/consideRatio/761c6286158e70feaed7
*
* Working authentication with
* Firebase 2.0.x + Ember.js 1.8.1 + Ember Data Canary + EmberFire 1.3.0 + Ember CLI
* works for me! oskar@rough.dk
*
* 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
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass
@function strip-units($number)
@return $number / ($number * 0 + 1)
// pow and sqrt required by ease function
// adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss
@function pow($base, $exponent)
$value: $base
You can’t perform that action at this time.