Permalink
Browse files

- Initial Commit

  • Loading branch information...
0 parents commit 549a48954f2402cd43d9769236f55a46776fc614 @colintoh committed Aug 21, 2013
@@ -0,0 +1,20 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+.DS_Store
+
+public
+
+pids
+logs
+results
+
+aws.json
+
+node_modules
+npm-debug.log
@@ -0,0 +1,59 @@
+module.exports = function (grunt) {
+
+
+ // Get path to core grunt dependencies from Sails
+ grunt.loadNpmTasks('grunt-s3');
+ grunt.loadNpmTasks('grunt-exec');
+
+
+ // Project configuration.
+ grunt.initConfig({
+ aws: grunt.file.readJSON('aws.json'),
+ s3: {
+ options: {
+ key: '<%= aws.key %>',
+ secret: '<%= aws.secret %>',
+ bucket: '<%= aws.bucket %>',
+ access: '<%= aws.access %>'
+ },
+ dev:{
+ options: {
+ encodePaths: true,
+ maxOperations: 20
+ },
+ upload: [{
+ // Wildcards are valid *for uploads only* until I figure out a good implementation
+ // for downloads.
+ src: 'public/javascripts/*',
+
+ // But if you use wildcards, make sure your destination is a directory.
+ dest: './javascripts/'
+ },{
+ // Wildcards are valid *for uploads only* until I figure out a good implementation
+ // for downloads.
+ src: 'public/stylesheets/*',
+
+ // But if you use wildcards, make sure your destination is a directory.
+ dest: './stylesheets/'
+ },{
+ // Wildcards are valid *for uploads only* until I figure out a good implementation
+ // for downloads.
+ src: 'public/*',
+
+ // But if you use wildcards, make sure your destination is a directory.
+ dest: './'
+ }
+
+ ]
+ }
+ },
+ exec: {
+ brunch_build: {
+ command: 'brunch build -o'
+ }
+ }
+ });
+
+ grunt.registerTask('deploy',['exec','s3']);
+
+};
@@ -0,0 +1,105 @@
+Ember-Brunch
+============
+
+Ember-Brunch embodies [modern web development workflow](http://www.youtube.com/watch?v=vDbbz-BdyYc) with the help of brunch.io and the ember.js framework. Having a awesome development workflow is important because you want to:
+
+- ***Reduce*** development time.
+- ***Reduce*** bugs.
+- ***Reduce*** unneccessary premature hairloss.
+
+What ***Ember-Brunch*** can do for you:
+
+- Organize your javascript files into modules.
+- Prevent pollution of the global scope.
+- Front-end MVC framework.
+- Auto-detect and prompt JS errors the very moment you save the files.
+- Auto-reload the browser everytime you save the files.
+- A buffet selection of preprocessors to save development time: LESS, STYLUS, JADE, TYPESCRIPT etc...
+- Build a production-ready app with just a single command and be ready to deploy.
+
+
+Dependencies:
+
+ - Install Node.js: http://nodejs.org/download/
+ - Install Brunch 1.7.0 (The latest 1.7.1 breaks the build) : ``` npm install -g brunch@1.7.0```
+ - Install command line tool from XCode
+ - Install scaffolt if you want to use generator: *(Optional but highly recommended)* ``` npm install -g scaffolt```
+
+Getting Started
+===========
+
+Create a new app with the skeleton:
+```brunch new https://github.com/colintoh/ember-brunch.git [appname] ```
+
+Start the server and watch:
+```cd [appname] && brunch watch -s```
+
+Deployment(New)
+===========
+Build a production folder:
+```brunch build -o```
+
+Your app will be compiled and minified into the ```public``` folder. Upload that folder to any host(S3 etc) and you are done!
+
+Or let ***GRUNT*** do both together for you!
+
+### S3 deployment
+1. Install grunt-cli: ```npm install -g grunt-cli```
+2. Create a bucket at S3 and set it as static web server.
+3. Fill up aws.json with your credentials.
+4. In your root directory, run ```grunt deploy``` and your code will be live on your S3's url. :)
+
+File Structure
+==============
+
+The ```app``` folder stores all file that you will need to start the project. ```app/helper``` stores all your controller+view files. ```app/templates``` and ```app/styles``` stores your handlebars templates and css respectively.
+
+```templates.js``` and ```helper.js``` contains all the files that you want your projects to import in when the server runs. And lastly, ```router.js``` is where you configure your routing.
+
+Generate scaffold
+==================
+Without generators, you will have to manually type in alot of repetitive code. With the node module ```scaffolt```, you can easily generate controllers, views and template files and append them to the ```templates.js``` and ```helper.js``` files.
+
+Let's create a **recipe** controller, view and template with the **class** generator.
+Inside your application root directory, type ```scaffolt class recipe``` in your terminal. This will generate:
+
+ // Inside helper/recipe.js
+
+ var App = require('app');
+
+ App.RecipeController = Em.Controller.extend({
+
+ });
+
+
+ App.RecipeView = Em.View.extend({
+ didInsertElement: function(){
+ }
+ });
+
+and a template call *recipe.hbs* in the ```template``` folder:
+
+ The name of the template: recipe
+
+In your ```router.js``` file, manually append your recipe route:
+
+ App.Router.map(function(){
+ this.route('index',{path:'/'});
+ this.route('home');
+ this.route('nextpage');
+ this.route('recipe'); <--------- Insert this line
+ });
+
+Enter ```localhost:[port-number]/#/recipe``` and you will see your new changes.
+
+
+Want to know more about Brunch and Ember?
+=================================
+
+[Brunch.io](http://brunch.io/)
+
+Brunch is an assembler for HTML5 applications. It is a simple but powerful build process and pipeline. It’s agnostic to frameworks, libraries, programming, stylesheet & templating languages and backend technology.
+
+[Ember JS](http://emberjs.com/)
+
+A framework for creating ambitious web applications.
@@ -0,0 +1,5 @@
+Application
+===========
+
+Put your application-specific files here, but leave your third party libraries in the vendor directory.
+
@@ -0,0 +1,3 @@
+// Application bootstrapper
+
+module.exports = Em.Application.create();
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
+<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
+<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
+<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Example brunch application</title>
+ <link href='http://fonts.googleapis.com/css?family=Sonsie+One' rel='stylesheet' type='text/css'>
+ <link href='http://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
+ <link rel="stylesheet" href="stylesheets/app.css">
+ <script>
+ window.brunch = window.brunch || {};
+ window.brunch['auto-reload'] = {enabled: true};
+ </script>
+ <script src="javascripts/vendor.js"></script>
+ <script src="javascripts/app.js"></script>
+ <script>require('initialize');</script>
+</head>
+<body>
+ <!-- ApplicationView -->
+ <script>
+
+
+ $(function(){
+ $('#demo').on('click',function(){
+ $(document).skylo('start');
+
+ setTimeout(function(){
+ $(document).skylo('set',50);
+ },1000);
+
+ setTimeout(function(){
+ $(document).skylo('end');
+ },1500);
+ });
+
+ $('#start').on('click',function(){
+ $(document).skylo('start');
+ });
+
+ $('#end').on('click',function(){
+ $(document).skylo('end');
+ });
+
+ $('#set').on('click',function(){
+ $(document).skylo('show',function(){
+ $(document).skylo('set',50);
+ });
+ });
+
+ $('#get').on('click',function(){
+ alert($(document).skylo('get')+'%');
+ });
+
+ $('#inch').on('click',function(){
+ $(document).skylo('show',function(){
+ $(document).skylo('inch',10);
+ });
+ });
+
+
+ })
+ </script>
+</body>
+</html>
@@ -0,0 +1,3 @@
+require('helpers/application');
+require('helpers/home');
+require('helpers/nextpage');
@@ -0,0 +1,12 @@
+var App = require('app');
+
+App.ApplicationController = Em.Controller.extend({
+ title: "Skylo"
+});
+
+
+App.ApplicationView = Em.View.extend({
+ didInsertElement: function(){
+
+ }
+});
@@ -0,0 +1,12 @@
+var App = require('app');
+
+App.HomeController = Em.Controller.extend({
+
+});
+
+
+App.HomeView = Em.View.extend({
+ didInsertElement:function(){
+ console.log('123');
+ }
+});
@@ -0,0 +1,10 @@
+var App = require('app');
+
+App.NextpageController = Em.Controller.extend({
+
+});
+
+
+App.NextpageView = Em.View.extend({
+
+});
@@ -0,0 +1,8 @@
+window.App = require('app');
+
+
+require('template');
+require('helper');
+require('router');
+
+App.initialize();
@@ -0,0 +1,14 @@
+var App = require('app');
+
+
+App.IndexRoute = Em.Route.extend({
+ redirect:function(){
+ this.transitionTo('home');
+ }
+});
+
+App.Router.map(function(){
+ this.route('index',{path:'/'});
+ this.route('home');
+ this.route('nextpage');
+});
Oops, something went wrong.

0 comments on commit 549a489

Please sign in to comment.