Skip to content

Instantly share code, notes, and snippets.

var Handlebars = require('handlebars');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
yaml: {
docs: {
files: [{
expand: true,
{
"title": "Lesson 2: Tasty Sandwiches",
"author": "jmeas",
"updatedAt": "2014-09-03T03:33:49Z",
"createdAt": "2014-09-02T20:11:40Z",
"public": true,
"pages": [
{
"pageName": "Some PageName",
"sections": [
/**
* React v0.12.2
*
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*

Multiple Model types

let BaseModel = DS.Model.extend({
  type: DS.attr('string'),
});

BaseModel.reopenClass({
  createModel(attrs) {
 if (Ember.get(attrs, 'type') === 'foo') {
{{!-- templates/component/foo-component.hbs --}}
<div class="foo">
  <div class="foo-body">
    {{yield}}
  </div>
  <div class="foo-aside">
    {{yield content-for="aside"}}
  </div>
@jamiebuilds
jamiebuilds / babel-plugin-ideas.md
Last active August 29, 2015 14:18
Babel Plugin Ideas

Babel Plugin Ideas

babel-plugin-backbone

import {View} from 'backbone';

export default class MyView extends View {
  initialize() {
    this.$el.css('color', 'red');
// Warning:
// super duper pseudo-code which won't work in any browser today.
class Component extends Element {
render() {
this.innerHTML = this.template();
}
}
class MyComponent extends Component {
export default function ({Plugin, types: t}) {
return new Plugin('remove-comments', {
visitor: {
Program(node, parent, path, file) {
file.ast.comments = [];
},
enter(node) {
node.leadingComments = null;
node.trailingComments = null;
}
@jamiebuilds
jamiebuilds / index.html
Last active December 10, 2015 00:39
CSS3 Flat 3D Text — Created with CodePen: codepen.io/pen/ljvzi
<h1>@thejameskyle</h1>
@jamiebuilds
jamiebuilds / gulpfile.js
Last active December 21, 2015 12:51
Example single-file gulp setup
import {src, dest, watch, parallel, series} from 'gulp';
import lintPlugin from 'gulp-lint-plugin';
import testPlugin from 'gulp-test-plugin';
import buildPlugin from 'gulp-build-plugin';
const SRC_DIRECTORY = './src';
const TEST_DIRECTORY = './test';
const DIST_DIRECTORY = './dist';
const lintDir = dir => src(dir)