Skip to content

Instantly share code, notes, and snippets.

class App extends React.Component {
componentDidMount () {
history.listen((location) => {
this.props.dispatch({ type: 'ROUTE_CHANGE', location })
})
},
render () {
return (
// this file is designed to freak you out
const fs = require('fs')
const path = require('path')
const hbs = require('handlebars')
const cheerio = require('cheerio')
!function main() {
return process.stdout.write(
template()(
templateLocals()))}()
define ['require', 'ember'], (req, Ember) ->
underscore = Ember.String.underscore
Ember.DefaultResolver.extend
base: ''
# attempts to require the module from the AMD registry
resolve: (fullName) ->
@ryanflorence
ryanflorence / upgrade-bash.sh
Created February 7, 2014 03:23
update your bash on mac os x, because 3.2 is old
brew install bash
echo "/usr/local/bin/bash" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/bash
var Ember = require('ember');
Ember.Route.reopen({
model: function(params, transition) {
var match, name, sawParams, value;
for (var prop in params) {
if (prop === 'queryParams') { continue; }
if (match = prop.match(/^(.*)_id$/)) {
name = match[1];
var Ember = require('ember');
Ember.Route.reopen({
model: function(params, transition) {
var match, name, sawParams, value;
for (var prop in params) {
if (prop === 'queryParams') { continue; }
if (match = prop.match(/^(.*)_id$/)) {
name = match[1];
<!doctype html>
<meta charset="utf-8">
<link rel="stylesheet" href="bower_components/qunit/qunit/qunit.css">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/handlebars/handlebars.js"></script>
<script src="bower_components/ember/ember.js"></script>
{{#ic-tabs}}
{{#ic-tab}}
{{#ic-tab-label}}Foo{{/ic-tab-label}}
{{#ic-tab-content}}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
Function.prototype.compile = function() {
var template = this.toString().split('\n').slice(1,-1).join('\n') + '\n';
return Ember.Handlebars.compile(template);
}
/*******************************************************/
test('sets first tab found to active', function() {
expect(2);
var component = this.subject({
import { Component, computed } from 'ember';
export default Component.extend({
tagName: 'ic-tab-panel',
attributeBindings: [
'role',
'aria-labeledby'
],