This file contains 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
Running watch.js on node 0.10.17 and OS X 10.8.5 gives the following when editing (in Sublime Text) and saving file in the same directory: | |
change : a.txt | |
rename : .subl319.tmp | |
change : a.txt | |
rename : .subl69d.tmp | |
etc... | |
Doing the same on 0.10.18 gives: |
This file contains 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
var fs = require('fs'); | |
var read = require('read'); | |
var myBook = []; | |
var data = fs.readFileSync(__dirname + '/data.json', { encoding: 'utf8', flag: 'a+' }); | |
if (data) { | |
myBook = JSON.parse(data); | |
} |
This file contains 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
function ifFilesExist (files, cb) { | |
var numberOfFiles = files.length | |
, returnsChecked = 0 | |
, existancesConfirmed = 0; | |
for (var i = 0; i < numberOfFiles; i++) { | |
fs.exists(files[i], next); | |
} | |
function next (e) { |
This file contains 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
it("given I'm allergic to nuts and hate mushrooms, it should find a pizza I can eat (imperative)", function () { | |
var i,j,hasMushrooms, productsICanEat = []; | |
for (i = 0; i < products.length; i+=1) { | |
if (products[i].containsNuts === false) { | |
hasMushrooms = false; | |
for (j = 0; j < products[i].ingredients.length; j+=1) { | |
if (products[i].ingredients[j] === "mushrooms") { | |
hasMushrooms = true; |
This file contains 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
{ | |
"name": "knode.github.io", | |
"version": "0.0.1", | |
"description": "knode.github.io ===============", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"postupdate": "echo \"Updated...\" && exit 0" | |
}, | |
"repository": { |
This file contains 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
requirejs.config({ | |
baseUrl: '/js', | |
paths: { | |
'backbone': 'lib/backbone', | |
'underscore': 'lib/underscore', | |
'jquery': 'lib/jquery', | |
'hbs': 'lib/require-handlebars-plugin/hbs', | |
'templates': '../templates' | |
} | |
}); |
This file contains 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
var request = require('request'); | |
var moment = require('moment'); | |
var http = require('http'); | |
var colors = require('colors'); | |
var latLong = "45.5330,-122.6894"; | |
var apiKey = "a75c248d7b83806b66b281dd33e96e36"; | |
var url = 'https://api.forecast.io/forecast'; | |
url += '/' + apiKey + '/' + latLong; |
This file contains 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
var { Transform } = require('stream'); // use require for non-ES6 Node modules | |
class MyStream extends Transform { | |
constructor (options) { | |
super({ | |
lowWaterMark: 0, | |
encoding: 'utf8' | |
}); | |
} |
This file contains 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
zip(); | |
zap(); | |
zoom(); | |
function zip () { | |
var a = 1; | |
(function () { | |
// v8 will remove the outer closure | |
debugger; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>minimap</title> | |
<style> | |
#ref { | |
display: none; | |
} | |
</style> |
OlderNewer