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> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>RedBoy</title> | |
<meta name="description" content="ble test scanning"> | |
<script src="jquery-1.11.1.min.js"></script> |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<widget xmlns = "http://www.w3.org/ns/widgets" | |
xmlns:gap = "http://phonegap.com/ns/1.0" | |
id = "com.phonegap.example" | |
versionCode = "10" | |
version = "1.0.0" > | |
<!-- versionCode is optional and Android only --> | |
<name>JRed</name> |
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
app.get("/user/:userid", function (req, res, next) { | |
var id = parseInt(req.params.userid); | |
if (id === 'John') { | |
next(); | |
} else { | |
//do something with the none John user id | |
} | |
}); |
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
meta = { | |
module : { | |
author : author, | |
title : title, | |
descrip : description, | |
clips : [{clip : {$ : {href : 'test'}, | |
description : 'test' | |
}}] | |
} | |
} |
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
doAsyncThing.then(function(result){ | |
return doAnotherAsyncThing().then(function(result){ | |
return doYetAnotherAsyncThing().then(function(result){ | |
console.log("Done!"); | |
}); | |
}); | |
}).catch(function(err){ | |
/* This is where errors from *any* of the above promises end up. */ | |
}); |
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
const cluster = require('cluster'); | |
if (cluster.isMaster) { | |
let router = zmq.socket('router').bind('tcp://127.0.0.1:5433'); | |
// forward messages between router and dealer | |
router.on('message', function() { | |
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
/* UPDATED: This example has been changed to use the new object predicates, that were | |
* introduced in Bluebird 3.0. If you are using Bluebird 2.x, you will need to use the | |
* older example below, with the predicate function. */ | |
var Promise = require("bluebird"); | |
var fs = Promise.promisifyAll(require("fs")); | |
Promise.try(function(){ | |
return fs.readFileAsync("./config.json").then(JSON.parse); | |
}).catch({code: "ENOENT"}, function(err){ |
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
async.series([ | |
function(callback){ | |
// do some stuff ... | |
callback(null, 'one'); | |
}, | |
function(callback){ | |
// do some more stuff ... | |
callback(null, 'two'); | |
} | |
], |
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
class AutoComponent extends React.Component { | |
constructor() { | |
super() | |
var cls = this.constructor | |
var methods, methodName | |
while (cls !== AutoComponent) { | |
methods = Object.getOwnPropertyNames(cls.prototype) | |
for (var i in methods) { | |
methodName = methods[i] | |
if (methodName.match(/^on[A-Z]/) !== null) { |
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
############################################################ | |
# Builds a Meteor 0.9.x+ application Docker image | |
# | |
# See: http://docs.docker.io/ | |
# | |
# Important: Best to run from a clean directory that hasn't had meteor run in it. | |
# Important: packages/<pkg>/.npm and .build* should not exist | |
# | |
# Example usage: | |
# cd appdir #in app dir |
OlderNewer