After you have downloaded and installed node-webkit,
create a directory on your hard-drive named myapp.
Place all files of this gist inside the created directory:
- myapp/
- app.js
- index.html
After you have downloaded and installed node-webkit,
create a directory on your hard-drive named myapp.
Place all files of this gist inside the created directory:
| "use strict"; | |
| // Module Dependencies & Initializations | |
| var createServer = require("http").createServer; | |
| var qs = require("querystring"); | |
| var server = createServer(); | |
| server.on("request", function onRequest(req, res) { | |
| var params = qs.parse(req.url); |
| // See http://flatuicolors.com/ | |
| $alizarin = #e74c3c | |
| $amethyst = #9b59b6 | |
| $asbestos = #7f8c8d | |
| $belize-hole = #2980b9 | |
| $carrot = #e67e22 | |
| $clouds = #ecf0f1 | |
| $concrete = #95a5a6 | |
| $emerald = #2ecc71 | |
| $green-sea = #16a085 |
| angular.module('phonecatFilters', []) | |
| .filter('checkmark', function() { | |
| return function(input) { | |
| return input ? '\u2713' : '\u2718'; | |
| }; | |
| }) | |
| .filter('foobar', function() { | |
| return function(input) { | |
| return 'foobar'; | |
| }; |
| /* Based on http://goldengridsystem.com */ | |
| .col { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| box-sizing: border-box; | |
| float: left; | |
| padding-left: 0.75em; | |
| padding-right: 0.75em; | |
| } |
| 'use strict'; | |
| var feathers = require('feathers'); | |
| var rubberduck = require('rubberduck'); | |
| var tasks = []; | |
| var emitter = rubberduck.emitter(tasks).punch('push'); | |
| emitter.on('beforePush', function(args, instance) { | |
| console.log(new Date(), 'About to push ' + args[0]); |
| // Original code by David Walsh: http://davidwalsh.name/pubsub-javascript | |
| var events = (function(){ | |
| var topics = {}; | |
| return { | |
| subscribe: function(topic, listener) { | |
| // Create the topic's object if not yet created | |
| if(!topics[topic]) topics[topic] = { queue: [] }; | |
| // Add the listener to queue |
| define(function () { | |
| "use strict"; | |
| $("#main-toolbar").hide(); | |
| }); |
| define(function () { | |
| "use strict"; | |
| var AppInit = brackets.getModule("utils/AppInit"), | |
| FileSystem = brackets.getModule("filesystem/FileSystem"), | |
| ProjectManager = brackets.getModule("project/ProjectManager"); | |
| AppInit.appReady(function () { | |
| var filename = ProjectManager.getProjectRoot().fullPath + "hello-world.txt"; | |
| FileSystem.getFileForPath(filename).write("Hello world!\n"); |
Original author: @gpetrov
Original source: rogerwang/node-webkit/#149 (comment)