Skip to content

Instantly share code, notes, and snippets.

View rtablada's full-sized avatar

Ryan Tablada rtablada

View GitHub Profile
import Component from '@ember/component';
import { set } from '@ember/object';
import { action, computed } from '@ember-decorators/object';
import { layout, classNames } from '@ember-decorators/component';
import hbs from 'htmlbars-inline-precompile';
const WORDS_PER_SEC = 200 / 60; // Assumption: 200 words per minute
export class CountingTextareaManager {
constructor(str) {
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs() {
this._super(...arguments);
const filterBy = this.get('filter');
if (filterBy !== null) {
this.set('items', this.filterItems(filterBy));
} else {
console.log('no filter');
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
todos: Ember.computed(function() {
return [];
}),
actions: {
add: function() {
@rtablada
rtablada / application.controller.js
Last active December 31, 2015 01:14 — forked from jmaziarz/application.controller.js
Breakdown Component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@rtablada
rtablada / new-post.sh
Last active October 26, 2015 01:17 — forked from scooooooooby/new-post.sh
Create Jekyll posts with their YAML matter quickly from the command line.
jekyll-post () {
#!/bin/bash
echo "Title of post:"
read title
echo "Description of post:"
read description
echo "Tag post:"
@rtablada
rtablada / gist:a509ad1ff0a1063ea603
Created October 20, 2015 03:04 — forked from mattstauffer/gist:a2376484ea2e19325e3c
Something something node modules something

(just a test, this is written by @rtablada not me)

After working with a lot of node modules I'm a bit angered by the fact that for a lot of these packages you have to pass around and keep track of a single shared instance throughout your application.

This works fine for small proxy servers and apps where the whole thing fits into a single app.js or maybe a handful of route files. But as things start to grow this model really breaks down and becomes cumbersome.

Just think about a resource file for app/resources/users.js which needs the current Redis or RabbitMQ connection to publish events like user registration, a database connection to persist things, and probably a Socket.io instance because it's Real Time: it's so hot right now! If you export a function that allows these to be injected, your resource has boilerplate.

./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \