This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| var dot, | |
| tooltip; | |
| var help = function (steps) { | |
| dot = dot || $('<div class="dot">').appendTo('body'); | |
| tooltip = tooltip || $('<div class="tooltip">').hide().appendTo('body'); | |
| steps = steps.slice(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>WADL parser</title> | |
| <link rel="stylesheet" href="application.css"/> | |
| <style type="text/css"> | |
| ul#output { | |
| list-style: none outside; | |
| margin: 0 0 20px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var requireQueue = function(modules, callback) { | |
| function load(queue, results) { | |
| if (queue.length) { | |
| require([queue.shift()], function(result) { | |
| results.push(result); | |
| load(queue, results); | |
| }); | |
| } else { | |
| callback.apply(null, results); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var can = Backbone.Role.can; | |
| var EntitiesController = Backbone.Controller.extend({ | |
| before: { | |
| index: function() { | |
| return can('read', 'entities'); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Handlebars helper | |
| var ViewsCache = Backbone.View.ViewsCache = {}; | |
| Handlebars.registerHelper('view', function(view, options) { | |
| var id = _.uniqueId('view-'); | |
| views[id] = { view: view, options: options.hash }; | |
| return new Handlebars.SafeString('<script type="text/view" data-view-id="' + id + '"></script>'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| grunt.loadNpmTasks('grunt-bower-task'); | |
| grunt.initConfig({ | |
| bower: { | |
| install: { | |
| options: { | |
| verbose: true, | |
| cleanup: true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rails_apps_composer new APP_NAME -r core frontend init railsapps setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var flattenObj = function (object, target, prefix) { | |
| prefix = prefix || ''; | |
| return _(object).inject(function(result, value, key) { | |
| if (_.isObject(value)) { | |
| flattenObj(value, result, prefix + key + '.'); | |
| } else { | |
| result[prefix + key] = value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "the-web-app", | |
| "version": "0.0.1", | |
| "dependencies": {}, | |
| "devDependencies": { | |
| "grunt": "0.4.0", | |
| "grunt-contrib-copy": "0.4.0", | |
| "grunt-contrib-sass": "0.2.2", | |
| "grunt-contrib-connect": "0.1.2", | |
| "grunt-contrib-watch": "0.2.0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Hello world".replace(/[aeoiu]/g, function(match, matchIndex) { | |
| console.log(match, matchIndex); | |
| }); | |
| // -> e, 1 | |
| // -> o, 4 | |
| // -> o, 7 |