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
var net = require('net'); | |
var chalk = require('chalk'); | |
var lh = 'localhost'; | |
var EventEmitter = require('events').EventEmitter; | |
//var exec = require('child_process').exec; | |
var execSync = require('child_process').execSync; | |
var warn = console.log | |
var ee = new EventEmitter(); | |
ee.on('down', function(serviceName, had_error) { |
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
var oracle = require('strong-oracle')(); | |
// Or use the other Oracle driver | |
// var oracle = require('oracle'); | |
var OracleQueryStream = require('oracle-query-stream'); | |
var JSONStream = require('JSONStream'); | |
var db = require('./db'); |
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
➜ manager git:(master) gem install json -v '1.8.3' | |
Building native extensions. This could take a while... | |
ERROR: Error installing json: | |
ERROR: Failed to build gem native extension. | |
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator | |
/usr/local/opt/ruby/bin/ruby -r ./siteconf20170915-30761-ln2kx2.rb extconf.rb | |
creating Makefile | |
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator |
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
** Node 8 ** | |
results for 10000 parallel executions, 1 ms per I/O op | |
file time(ms) memory(MB) | |
callbacks-baseline.js 156 31.35 | |
callbacks-suguru03-neo-async-waterfall.js 189 39.54 | |
promises-bluebird-generator.js 246 41.37 | |
promises-bluebird.js 322 48.27 | |
promises-cujojs-when.js 393 61.61 | |
promises-tildeio-rsvp.js 503 78.96 |
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
'use strict'; | |
/** | |
"One line" QueryString parser | |
Initial question-mark optional | |
Handles repeated parameters (turns into array) | |
Handles null parameters | |
Handles + sign in parameters |
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
<html> | |
<head> | |
<title>DOMContentLoaded vs jQuery</title> | |
</head> | |
<body> | |
<h1> | |
With jQuery (2.1.4) if a function throws in a $(document).ready listener, it will prevent subsequent | |
$(document).ready listeners from executing. This demonstrates that it does not happen with jQuery 3.1.1 or document.addEventListener. | |
</h1> |
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
var store = redux.createStore(function(state, action) { | |
var defaultState = { | |
view: LOGIN, | |
subview: '', | |
} | |
if (!state) { | |
return defaultState; | |
} | |
switch(action.type) { |
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 jade = require('jade') | |
app.use((req, res) => { | |
const locals = req.locals // get your template locals from where ever | |
locals.cache = process.env.NODE_ENV === 'production' // set the template cache | |
const html = jade.renderFile('templates/home.jade', locals) // render the template | |
res.setHeader('Content-Length', Buffer.byteLength(html)) | |
res.setHeader('Content-Type', 'text/html; charset=utf-8') // set the content type header | |
res.end(html) // send the response | |
}) |
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
------ | |
built in rejection: | |
Promise.reject(new Error('ether')) | |
(no error console output with V8 promise rejection, nothing shown on screen, no non-zero exit code on process, etc.) | |
-------- | |
Promise = require('bluebird') |
NewerOlder