Skip to content

Instantly share code, notes, and snippets.

View twilson63's full-sized avatar

Tom Wilson twilson63

View GitHub Profile

Angular-UI - ui-router

Lately, I have been digging into the angular-ui-router, (https://github.com/angular-ui/ui-router), I would say from ng-conf, it is the recommended way to do routing in Angular. What I find interesting about it, is how you can have multiple views and your routing graph can be defined in your loosely coupled modules. This provides a very conventional way to assembling your angular.modules for an angularjs application. Instead of having several features in your controller and templates directory, you can have several repositories that just focus on a particular feature.

For example, if you have two CRUD modules, (projects and contacts), with ui-router you can keep each routing state independent of the other as long as they are unique.

So in one module projects, I can have a config section and create the following routing state:

angular.js('projects', [])
anonymous
anonymous / nodewebkit.md
Created June 27, 2013 02:08

Install instructions for nodewebkit on fedora 19 beta

download nodewebkit zip, extract to home directory

yum install curl -y
curl -O https://s3.amazonaws.com/node-webkit/v0.6.1/node-webkit-v0.6.1-linux-ia32.tar.gz
tar -zxvf node-webkit-v0.6.1-linux-ia32.tar.gz
ln -s /usr/lib/libudev.so.1 /usr/lib/libudev.so.0
export PATH=$PATH:/home/username/node-webkit-v0.6.1-linux-ia32
@twilson63
twilson63 / Gruntfile.js
Last active December 16, 2015 12:49
Gruntfile.js Template
var www = 'public';
var appFiles = [
www + '/app/app.js',
www + '/app/services/*.js',
www + '/app/filters/*.js',
www + '/app/directives/*.js',
www + '/app/controllers/*.js'
];
@twilson63
twilson63 / install.md
Last active October 14, 2015 01:48
Install CouchDb and NodeJs on Ubuntu 12.04

Install CouchDb and NodeJS

Prereqs

sudo apt-get update -y
sudo apt-get install git-core build-essential -y

NodeJS 0.10.x

@Marak
Marak / gist:3240974
Created August 2, 2012 21:50
WIP - Flatironisms

WIP

log all incoming http requests

app.http.before.push(function(req, res){
  app.log.info(req.url);
  res.emit('next');
})