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 dependencies. | |
*/ | |
var express = require('express'), | |
http = require('http'), | |
RedisStore = require('connect-redis')(express), | |
redis = require('redis'), | |
cookie = require('cookie'), | |
connect = require('connect'), |
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 db = new (require('cradle').Connection)().database('my_db'); | |
db.info(function(err, result) { | |
var seq = result.update_seq; | |
db.changes({since: seq, include_docs: true}).on('change', function(change) { | |
if (change.doc && change.doc.owner) { | |
io.sockets.in(change.doc.owner).emit('change:' + change.doc.type, decorate(change.doc)); | |
} | |
}); | |
}); |
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'; | |
/* | |
* Express server using ES6 generators | |
* Use node 0.11 | |
* run with node --harmony express-server-generator.js | |
*/ | |
var Q = require('q'), | |
HTTP = require('q-io/http'), | |
express = require('express'), | |
http = require('http'); |
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>Post form in a new window without losing handle to the window</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script> | |
$(function() { | |
$('form').on('submit', function(ev) { | |
var form = $(this); | |
form.attr('target', 'new-window'); |
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 scripts = document.getElementsByTagName('script'); | |
document.writeln(scripts[scripts.length - 1].getAttribute('data-attribute')); |
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
class LibraryView extends Backbone.View | |
initialize: (opts) -> | |
@collection.selectedCount.assign this.$('.selected_count'), 'text' | |
@collection.hasSelected.assign this.$('.selected_videos'), 'toggle' |
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
From 8fac3c9fb828a6a64ee386af089ff701719619bf Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Niklas=20Na=CC=88rhinen?= <[email protected]> | |
Date: Mon, 25 Mar 2013 21:45:54 +0200 | |
Subject: [PATCH] Failing test for coffeescript usage | |
--- | |
package.json | 77 ++++++++++++++++++++++++++++---------------------------- | |
test/bundle.js | 23 ++++++++++++++--- | |
2 files changed, 59 insertions(+), 41 deletions(-) |
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 browserify = require('browserify'), | |
fs = require('fs'); | |
var b = browserify().require('./vendor/jquery-1.9.1', { expose: 'jquery'}) | |
.require('./vendor/js_sha', { expose: 'jssha'}) | |
.require('./src/main', { entry: true }); | |
b.bundle(function(err, src) { | |
if (err) return console.error(err); | |
fs.writeFileSync('./dist/library-client.js', src); |
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
"{couch_httpd_proxy, handle_proxy_req, <<\"http://127.0.0.1:5985\">>}" |
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
Options -MultiViews -Indexes +FollowSymLinks | |
RewriteEngine On | |
RewriteRule ^api(.*) http://localhost:3011$1 [P] | |
RewriteCond %{REQUEST_URI} ^/(components|favicon|robots|images|scripts|styles|templates) [NC] | |
RewriteRule (.*) http://localhost:3501/$1 [P] | |
RewriteRule ^app(.*) http://localhost:3501$1 [P] | |
RewriteRule (.*) http://localhost:3501/ [P] |