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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "JSON API Schema", | |
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org", | |
"oneOf": [ | |
{ | |
"$ref": "#/definitions/success" | |
}, | |
{ | |
"$ref": "#/definitions/failure" |
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 Emitter = require('emitter'); | |
var slice = [].slice; | |
module.exports = QueueEmitter; | |
function QueueEmitter(){ | |
if( !(this instanceof QueueEmitter) ){ | |
return new QueueEmitter(); | |
} | |
this.queued = {}; |
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
abstract AVector(Array<Float>) { | |
public var x(get, never):Float; | |
public var y(get, never):Float; | |
public var z(get, never):Float; | |
public var length(get, never):Float; | |
public var lengthSq(get, never):Float; | |
public inline function new(x:Float, y:Float, z:Float=0.) this = [x, y, z]; | |
@:op(A+B) public static inline function add(a : AVector, b : AVector) : AVector { | |
return new AVector(a.x+b.x,a.y+b.y,a.z+b.z); |
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> | |
<title>Data Channel Demo 1</title> | |
<style> | |
button { | |
font: 18px sans-serif; | |
padding: 8px; | |
} | |
textarea { |
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() { | |
var | |
// Configuration: | |
hostname = window.CHANNEL_HOST || window.location.hostname || 'localhost', | |
websocketServer = "ws://"+hostname+":8000/", | |
// For browser compatibility: | |
PeerConnection = window.PeerConnection | |
|| window.RTCPeerConnection |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"code.google.com/p/go.net/websocket" | |
"strings" | |
"time" | |
) |
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 redis = require('redis') | |
, client = redis.createClient() | |
, assert = require('assert'); | |
// redis.debug_mode = true; | |
client.on("error", function (err) { | |
console.log("Error " + err); | |
}); |
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 express = require('express'); | |
function middleware(req,res,next){ | |
// do real funky stuff here... | |
// add access to funky stuff in routes | |
req.funky = function(){return 'funky stuff'} | |
// add access to funky stuff in views | |
res.locals.funky = function(){return 'funky stuff'} |
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
diff --git a/lib/parser.js b/lib/parser.js | |
index ca6fe8d..9673efe 100644 | |
--- a/lib/parser.js | |
+++ b/lib/parser.js | |
@@ -387,7 +387,7 @@ Parser.prototype = { | |
if (!this.filename) | |
throw new Error('the "filename" option is required to extend templates'); | |
- var path = name = this.expect('extends').val.trim() | |
+ var path = this.expect('extends').val.trim() |
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 (doc){ | |
var object = {'resource':'Post'}; | |
var match = function(){ | |
for( var k in object ) | |
if( object[k] !== doc[k] ) | |
return false; | |
return true; | |
}; | |
if( doc.resource === 'Post' && match() ){ | |
emit(doc._id, doc); |