Skip to content

Instantly share code, notes, and snippets.

View JBreit's full-sized avatar

Jason Breitigan JBreit

  • Inner Mind Co.
  • Lancaster, PA
View GitHub Profile
/*global angular*/
(function () {
'use strict';
var dataService = function ($http) {
var getData = function () {
return $http.get('http://127.0.0.1:8080/data/lists.json');
};
angular.module('app.services', [])
.factory('TasksService', function ($q, $timeout, $http) {
var service = Object.create(null);
service.getTasks = function () {
var deferred = $q.defer();
$http.get('data/lists.json')
.then(console.log.bind(console), console.log.bind(console))
/*global angular $*/
(function () {
'use strict';
angular.module('innermind.controllers', [])
.controller('IndexCtrl', [
'$scope',
'$state',
'$http',
/*global angular $*/
(function () {
'use strict';
angular.module('innermind.controllers', [])
.controller('MainCtrl', [
'$scope',
'$state',
'$http',
<!DOCTYPE html>
<html lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
/*global ReadableStream*/
(function () {
'use strict';
var interval;
var stream = new ReadableStream({
start: function (controller) {
@JBreit
JBreit / index.js
Last active April 2, 2017 23:11
Service Worker Experiment
(function (window) {
'use strict';
// Uncomment after getting https server to work on windows or finally have a Linux environment
// if ((!location.port || location.port === "8080") && location.protocol !== 'https:') {
// location.protocol = 'https:';
// }
/*console.log('location protocol: %s', location.protocol);
console.log('location port: %s', location.port);*/
var http = require('http'),
ecstatic = require("ecstatic"),
fileServer = ecstatic({root: "./public"}),
config = require('./options'),
router = require('./routes');
var normalizePort = function (val) {
'use strict';
var _port = parseInt(val, 10);
var fs = require('fs');
exports.GET = function (path, respond) {
'use strict';
fs.stat(path, function (error, stats) {
if (error && error.code === "ENOENT") {
respond(404, "File not found");
} else if (error) {
respond(500, error.toString());
@JBreit
JBreit / config.js
Created March 14, 2017 00:42
Part of an experimental Node.js configuration file
var normalizePort = require('./../../utils').normalizePort,
_defaults = [
/*"NODE_ENV",*/
"HOST",
"PORT"
];
_defaults.forEach(function (name) {