Skip to content

Instantly share code, notes, and snippets.

View robwormald's full-sized avatar

Rob Wormald robwormald

View GitHub Profile
<div class="panel panel-default" ng-click="select(card)" ng-mouseover="showCardStatus(card)">
<div class="panel-heading">
<h5 class="panel-title" ng-bind="card.sections.header.title">Panel title</h4>
<p class="panel-title text-muted" ng-bind="card.sections.header.subtitle">Panel title</p>
</div>
<div class="panel-body" ng-include src="templateUrl">This text is replaced by the custom template...</div>
<div class="panel-footer" >
<div class="list-unstyled">
<li ng-repeat="cardAction in card.sections.footer.actions">
<button type="button" ng-click="cardAction.onClick()" class="btn btn-link"><strong ng-bind="cardAction.actionText">Button Text</strong></button>
//psudeo code
$http.post('/foobar',{some : 'data'}).success(function(data,status,error,config){
if(data.user){ //or whatever you do to verify...
$http.post('/tracker',{other : 'data'}).success(function(data,status,err,config){
console.log('successfull track')
//psudeo code
//service
app.factory('User',function(restangular){
var UserModel = restangular.all('user')
return {
allUsers : UserModel.getList()
$http({method: 'GET', url: '/myfoos'}).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
@robwormald
robwormald / gist:8047424
Created December 19, 2013 22:36
config__slash__passport.js
ar passport = require('passport'),
oauth2orize = require('oauth2orize'),
jwtBearer = require('oauth2orize-jwt-bearer').Exchange,
login = require('connect-ensure-login'),
utils = require('../innitUtils.js');
module.exports = {
express: {
var appRootState = {
name: 'app',
url: '/',
templateUrl : '/templates/innit.app.home.html'
}
var employeesRoot = {
name: 'employees',
url: '/employees',
/**
* User
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
*
*/
var uuid = require('node-uuid')
var bcrypt = require('bcrypt')
, SALT_WORK_FACTOR = 10
module.exports.adapters = {
default: 'postgresql',
postgresql : {
//etc
},
rest: {
var request = require('request')
exports.loadData = function(query,callback) {
var _demoRequest = {
url : 'http://www.broadbandmap.gov/broadbandmap/demographic/dec2012/county/ids/17081',
qs : {format : 'json'}
}
return request.get(_demoRequest,callback)
//timelog from server
{
id : 123,
employee : 456,
project : 789
}
//project from server