Skip to content

Instantly share code, notes, and snippets.

View jayphelps's full-sized avatar
💭
I may be slow to respond.

Jay Phelps jayphelps

💭
I may be slow to respond.
View GitHub Profile
@sebmarkbage
sebmarkbage / ElementFactoriesAndJSX.md
Last active May 17, 2022 11:06
New React Element Factories and JSX

New React Element Factories and JSX

In React 0.12, we're making a core change to how React.createClass(...) and JSX works.

If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.

The Problem

@machty
machty / qp-limitation.md
Last active August 29, 2015 14:01
Basic/obvious QP limitation

Limitation regarding hrefs on non-route-driven controllers

TL;DR: lack of information about default values on non-route-driven controllers might force us to make href's overly verbose in some cases, or possible make us punt on non-route-driven-controller query params.

Scenario:

Router.map ->
  this.route('about')

// application.hbs
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 14, 2025 04:34
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

# This won't be live if bars is a hasMany relationship
foo.get 'bars'
# Instead do this and use the patch below to get a live array:
hasManyHack foo, 'bars'
# workaround for https://github.com/emberjs/data/issues/1308 -
# once the SSOT branch is merged this should be able to be replaced
@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations
(function(Ember) {
/**
Transforms a string so that it may be used as part of a 'pretty' / SEO friendly URL.
```javascript
'My favorite items.'.parameterize(); // 'my-favorite-items'
'action_name'.parameterize(); // 'action-name'
'100 ways Ember.js is better than Angular.'.parameterize(); // '100-ways-emberjs-is-better-than-angular'
```
@sjmiles
sjmiles / gist:9282062
Last active August 29, 2015 13:56
One History of `document.registerElement`

As I understand it, the original Custom Elements concept had a crystalline form: attach a class to a tag-name.

Using the yet-to-be ES6 syntax, it would look something like this:

  class MyElement extends HTMLElement {
    constructor() {
    }
    doStuff() {
 }
@raytiley
raytiley / auth.js
Last active August 29, 2015 13:56
A controller using SimpleLogin from Firebase. Returns promises from login / logout to make working with Ember Routing simple.
var dbRef = new Firebase("https://YOUR-FIREBASE.firebaseio.com/");
export default Ember.Controller.extend({
/**
@property currentUser
@type {User}
@default null
*/
currentUser: null,
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,