Skip to content

Instantly share code, notes, and snippets.

View alexlafroscia's full-sized avatar
👋
Looking for work! Need experience with Svelte or Ember.js? Get in touch!

Alex LaFroscia alexlafroscia

👋
Looking for work! Need experience with Svelte or Ember.js? Get in touch!
View GitHub Profile
@alexlafroscia
alexlafroscia / promise-proxy-array.js
Created May 28, 2015 17:44
Ember Promise Proxy Array
import Ember from 'ember';
/**
* Promise Proxy Array
* Custom Array class that, given a promise, will represent an empty array prior to promise resolution and the promise
* content after resolution.
*
* Example usage:
*
* const promise = this.store.get('users');
@alexlafroscia
alexlafroscia / keybase.md
Created August 20, 2015 04:32
Keybase Verification

Keybase proof

I hereby claim:

  • I am alexlafroscia on github.
  • I am alexlafroscia (https://keybase.io/alexlafroscia) on keybase.
  • I have a public key whose fingerprint is F4FE 088F BFFC 23E7 175C DDBB 5F2A A45C C7F7 5DE4

To claim this, I am signing this object:

@alexlafroscia
alexlafroscia / application.controller.js
Last active October 20, 2015 15:22
Bug: Can't observe property in inner component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@alexlafroscia
alexlafroscia / application.controller.js
Last active January 7, 2016 21:21
ES6 Interoperability Testing
import Ember from 'ember';
import extendBabelClass from '../utils/extend-babel-class';
class MyController {
get appName() {
return 'Ember Twiddle';
}
someCoolFunction() {
return 'This is my cool function';
@alexlafroscia
alexlafroscia / find_mutations.py
Last active February 1, 2016 03:13
Find mutations of a string
from sys import argv
def has_mutation(c):
if c == 't':
return '7'
if c == 'e':
return '3'
return None
@alexlafroscia
alexlafroscia / components.my-component.js
Last active July 29, 2016 21:32
Verify jQuery Trigger Bug in 2.8.0
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['my-component'],
foo: 'not clicked',
click() {
this.set('foo', 'clicked');
}
@alexlafroscia
alexlafroscia / controllers.application.js
Last active September 29, 2016 21:36
selection-wizard component
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
selections: [],
actions: {
'log-transition'(name, value) {
this.get('selections').pushObject(value);
@alexlafroscia
alexlafroscia / launch.json
Created October 7, 2016 01:19
Run `ember test` from VS Code
{
"version": "0.2.0",
"configurations": [
{
"name": "ember test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/ember",
"args": ["test"],
"sourceMaps": false,
@alexlafroscia
alexlafroscia / synchronize.js
Created October 14, 2016 23:34
Resolve an array of promises, one after the other
/**
* For each item in the array, call the callback, passing the item as the argument.
* However, only call the next callback after the promise returned by the previous
* one has resolved.
*
* @param {Array<*>} items the elements to iterate over
* @param {Function} cb called for each item, with the item as the parameter. Should return a promise
* @return {Promise}
*/
function synchronize(items, cb) {
@alexlafroscia
alexlafroscia / controllers.application.js
Last active November 29, 2016 17:01
No timeout with pauseTest
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});