Skip to content

Instantly share code, notes, and snippets.

View tbrd's full-sized avatar

Thomas Hamshere-Clarke tbrd

View GitHub Profile
@tbrd
tbrd / gulpfile.js
Last active August 29, 2015 13:56
Gulp hogan compile task
'use strict';
var gulp = require('gulp');
var refresh = require('gulp-livereload');
var livereload = require('tiny-lr');
var server = livereload();
var concat = require('gulp-concat');
var hogan = require('gulp-hogan-compile');
gulp.task('livereload-server', function () {
@tbrd
tbrd / hashtags.js
Created March 2, 2014 17:13
Hashtags component with internal template definition
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var defineComponent = require('flight/lib/component');
var withHogan = require('flight-hogan/lib/with_hogan');
@tbrd
tbrd / hashtags.spec.js
Last active August 29, 2015 13:56
Hashtags component spec
'use strict';
describeComponent('component/hashtags', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
});
it('should be defined', function () {
@tbrd
tbrd / hashtags.mustache
Created March 2, 2014 16:28
Hashtags template
<table class="js-hashtags">
<thead>
<tr>
<th>Hashtag</th>
<th>Frequency</th>
</tr>
</thead>
<tbody>
{{#hashtags}}
<tr>
@tbrd
tbrd / hashtags.json
Last active August 29, 2015 13:56
Hashtag data
{
"hashtags" : [
{
"text" : "trocadero",
"frequency" : 24
},
{
"text" : "beer"
"frequency" : 18
},
@tbrd
tbrd / default.js
Created February 22, 2014 10:52
Default page with searchForm and keywordProcessor
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var searchForm = require('component/search-form');
var keywordProcessor = require('component/keyword-processor');
@tbrd
tbrd / keyword-processor.js
Last active August 29, 2015 13:56
Keyword string processor
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var defineComponent = require('flight/lib/component');
@tbrd
tbrd / keyword-processor.spec.js
Last active August 29, 2015 13:56
Tests for keyword string processor
'use strict';
describeComponent('component/keyword-processor', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
});
it('should be defined', function () {
@tbrd
tbrd / default.js
Created February 12, 2014 13:45
Including the search form component in the default page
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var searchForm = require('component/search-form');
@tbrd
tbrd / search-form.js
Last active August 29, 2015 13:56
A search form component for Flight
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var defineComponent = require('flight/lib/component');