Skip to content

Instantly share code, notes, and snippets.

View joncodo's full-sized avatar
😎

Jonathan O'Donnell joncodo

😎
  • Altan Insights
  • Fredericton, NB
View GitHub Profile
Great job kevin!
console.log('in the create');
Application.create(app).exec(function(err, createdApp) {
if ( err || !createdApp ) {
console.log('error was', err);
}
console.log('app created');
return res.send(200);
});
myApp.controller('navController', function ($scope, $rootScope, $http, $location, UtilService) {
$scope.userResults = [];
$scope.searchPerformed = false;
$scope.searchToggled = false;
if ( !$rootScope.currentUser && UtilService.retrieve('x-access-token') ) {
console.log('Route changed and there is no current user set. Also, there now IS a token. Getting current user...');
$http.get('/me')
.success(function(data, status, headers, config) {
$rootScope.currentUser = {
<div data-ng-controller="navController">
<div id="user" data-ng-class="{ 'student' : currentUser.user_type === 'student' }">
<div>
<div class="userName">
<i class="user-icon"></i>
{{ currentUser.first_name + " " + currentUser.last_name }}
{{ currentUser.first_name == null ? 'My User' : ''}}
<a href="/#/logout/" class="logout"><i></i>Logout</a>
</div>
<div class="helpCircle">
@joncodo
joncodo / Angular-stackoverflow-23498356.markdown
Created November 26, 2014 18:43
Angular stackoverflow 23498356
<!DOCTYPE html>
<html data-ng-app>
<head>
<script src="/bower_components/angular/angular.js"></script>
</head>
<body>
<input ng-controller="DemoController"/>
<div>
myApp.controller('listUserController', function ($scope, $http, me, userList, UtilService) {
console.log('Users we got from server:');
console.log(JSON.stringify(userList, null, 2));
$scope.userList = userList;
$scope.em = me;
});
myApp.controller("editUserController", function ($scope, $modal, $http, me, userService, UtilService, organizations) {
$scope.nums = [];
$scope.saveResume = function () {
console.log('saved resume hit');
if($scope.file_uploads.length !==0){
$scope.profile.resume_url = $scope.file_uploads[0].url;
$http.post('/researcherUser/' + $scope.profile.id, $scope.profile).success(function (results) {
console.log('resume saved');
});
}
}
@joncodo
joncodo / asasdf
Created September 30, 2014 03:37
'44', 'Sweaters! Yo', 'Is this not the best sweater ever...', 'Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum', '05 April 2014', '01 January 2015', 'While quantities last', 'https://res.cloudinary.com/orangesprocket/image/upload/v1411045215/pfwrzmslvqssg4moxvin.jpg', 'https://res.cloudinary.com/orangesprocket/image/upload/w_206,h_206,c_fill/x_0,y_0,w_204,h_219,c_crop/pfwrzmslvqssg4moxvin.jpg', 'Inactive', 'CanadianTire', 'Electronics', NULL, NULL, NULL, NULL, '6', '2014-09-18 10:00:39', '2014-09-26 14:50:22'
'0', 'Light Bulb', 'aoeu', 'aoeu', '01 January 2014', '01 January 2014', 'aoeu', 'https://res.cloudinary.com/orangesprocket/image/upload/v1411045430/wyzrvj45feyjzjy5dbhl.jpg', 'https://res.cloudinary.com/orangesprocket/image/upload/w_165,h_220,c_fill/x_0,y_0,w_204,h_219,c_crop/wyzrvj45feyjzjy5dbhl.jpg', 'Inactive', 'CanadianTire', 'Appliances', NULL,
myApp.service('DealRetrievalService', ['$http', function($http) {
var _this = this;
return {
removeInactiveDeals: function (deals) {
var newDeals = [];
_.forEach(deals, function (deal) {
if(deal.status === 'Active'){
newDeals.push(deal);
}
});