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
// Routes | |
app.get('/', userIsAuthenticated, function(req, res){ | |
Doc.find( { loc : { $near : [50.62, -20.32], $maxDistance : 50 } } , function (err, docs) { | |
res.render('index_authenticated.jade', { | |
locals: { | |
title: 'Welcome back to Gociety', | |
status: 'logged in', | |
currentUser: req.currentUser, | |
user: req.currentUser, |
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 str = '63737472696b65'; | |
var num16 = parseInt(str, 16); | |
var str2 = 'f'; | |
console.log(parseInt(str2, 16)); |
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
<!-- start auto-generated posts --> | |
<?php while (have_posts()) : if (has_tag('featured')) { the_post(); } ?> <!-- <== BROKEN HERE --> | |
<div class="content" style="background: url(<?php bloginfo('template_url'); ?>/images/dummy-images/coffee.jpg);"> | |
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> | |
<div class="entry"> | |
<?php the_content(); ?> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<!-- end auto-generated posts --> |
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_modules/ |
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 obj = { "tricky": 'these "tick∫."' }; | |
var str = ''; | |
// | |
// npm install json-streamify | |
// | |
require('json-streamify').streamify(obj, function(data) { str += data; }); | |
console.log('%s', str); | |
console.log('%s', JSON.stringify(obj)); |
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 http = require('http') | |
, httpProxy = require('http-proxy') | |
, ns = require('node-static') | |
, file = new(ns.Server)('./public') | |
, url = require('url') | |
, querystring = require('querystring') | |
; | |
// | |
// Create a proxy server with custom application logic |
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
# install npm on machines with node at arbitrary spot | |
# node is installed at some arbitrary path | |
echo '# npm paths' >> ~/.bashrc | |
echo 'export PATH=~/bin:~/local/share/man:$PATH' >> ~/.bashrc | |
echo 'export MANPATH=$MANPATH:~/local/share/man' # I think this may not work | |
. ~/.bashrc | |
cat <<NPMRC >>$HOME/.npmrc | |
root = ~/.node_libraries | |
manroot = ~/local/share/man | |
binroot = ~/bin |
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 util = require('util') | |
, fs = require('fs') | |
, xml2js = require('xml2js-expat') | |
, querystring = require('querystring') | |
, _ = require('underscore'); | |
// this is provided by xml2js | |
function parse(xmlString, cb) { | |
var parser = new xml2js.Parser(); | |
parser.on('end', function(result) { |
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
// opts = { timeout: 60 } | |
function ExpiringMap(opts) { | |
var self = {} | |
, map = {} | |
, activeKeys = { | |
// key: clearTimeout | |
} | |
, noop = function() {}; | |
; |
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 932e9ced7dff802bb48843f531259fc2eda5a72d Mon Sep 17 00:00:00 2001 | |
From: David Trejo <[email protected]> | |
Date: Wed, 18 May 2011 18:39:06 -0700 | |
Subject: [PATCH] readline docs | |
--- | |
doc/api/readline.md | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++ | |
1 files changed, 133 insertions(+), 0 deletions(-) | |
create mode 100644 doc/api/readline.md |