Live Demo: TODO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global angular $*/ | |
(function () { | |
'use strict'; | |
angular.module('innermind.controllers', []) | |
.controller('IndexCtrl', [ | |
'$scope', | |
'$state', | |
'$http', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global angular*/ | |
(function () { | |
'use strict'; | |
var dataService = function ($http) { | |
var getData = function () { | |
return $http.get('http://127.0.0.1:8080/data/lists.json'); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
// Load grunt tasks automatically | |
require('load-grunt-tasks')(grunt); | |
// Time how long tasks take. Can help when optimizing build times | |
require('time-grunt')(grunt); | |
// Define the configuration for all the tasks | |
grunt.initConfig({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: "./src/main.js", | |
output: { | |
filename: "./dist/bundle.js" | |
}, | |
module: { | |
loaders: [{ | |
test: [/\.js$/, /\.es6$/], | |
exclude: /node_modules/, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { spawn } = require('child_process') | |
const { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync } = require('fs') | |
const utils = { | |
/** | |
* Convert an options object into a valid arguments array for the child_process.spawn method | |
* from: | |
* var options = { | |
* foo: 'hello', | |
* baz: 'world' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading; | |
namespace TestTrapCtrlC { | |
public class Program { | |
static bool exitSystem = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Console } = require('console'); | |
const { createWriteStream } = require('fs'); | |
const output = createWriteStream('./stdout.log'); | |
const errorOutput = createWriteStream('./stderr.log'); | |
const logger = new Console(output, errorOutput); | |
module.exports = logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { log } = require('./logger'); | |
switch (process.argv[2]) { | |
case 'start': | |
log('start command detected'); | |
break; | |
case 'stop': | |
log('stop command detected'); |