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 = { | |
/** | |
* Declares a new hook to which you can add pres and posts | |
* @param {String} name of the function | |
* @param {Function} the method | |
* @param {Function} the error handler callback | |
*/ | |
hook: function (name, fn, errorCb) { | |
if (arguments.length === 1 && typeof name === 'object') { | |
for (var k in name) { // `name` is a hash of hookName->hookFn |
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 loopback = require('loopback'); | |
var path = require('path'); | |
var app = module.exports = loopback(); | |
var started = new Date(); | |
/* | |
* 1. Configure LoopBack models and datasources | |
* | |
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions | |
*/ |
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
function X() { | |
} | |
Object.defineProperty(X.prototype, '__data', | |
{enumerable: false, configurable: true, writable: true, value: {x: 0}}); | |
var x1 = new X(); | |
console.log(Object.keys(x1)); | |
console.log(x1.__data); | |
x1.__data = {x: 1}; |
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
Statistical profiling result from /Users/rfeng/Demos/mssql-benchmark/v8-node-11.log, (114854 ticks, 208 unaccounted, 0 excluded). | |
[Unknown]: | |
ticks total nonlib name | |
208 0.2% | |
[Shared libraries]: | |
ticks total nonlib name | |
39 0.0% 0.0% /usr/lib/system/libsystem_pthread.dylib | |
33 0.0% 0.0% /usr/lib/system/libsystem_c.dylib |
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
/** | |
* Check if the given slot is empty (no piece placed) | |
*/ | |
function isEmpty(s) { | |
return s !== 'x' && s !== 'o'; | |
} | |
/** | |
* Get the state for a row with three slots | |
*/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<input id='num' value=10> | |
<input id='answer' type='text' readonly> | |
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
a { | |
font-size: 200%; | |
color: rgb(0,128,0); | |
} | |
h1 { | |
border:5px solid red; | |
box-shadow: 10px 10px 5px #888888; | |
} |
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
#!/bin/sh | |
(( ${#} > 0 )) || { | |
echo 'StrongLoop Node Uninstall script based on original script courtesy of Nice Robot Co.' | |
echo 'Press Control-C to quit now.' | |
read | |
echo 'Re-running the script with sudo.' | |
echo 'You may be prompted for a password.' | |
sudo ${0} sudo | |
exit $? | |
} |
NewerOlder