# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
var winston = require('winston') | |
require('winston-mongodb') | |
// prepare some custom log levels | |
var customLevels = { | |
levels: { | |
debug: 0, | |
info: 1, | |
warning: 2, | |
error: 3 |
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
var moment = require('moment'); | |
var tz = require('timezone/loaded'); | |
var time = require('time'); | |
module.exports = function() { | |
var strftime_format = '%F %T %z'; // used to convert a date into a normalized strftime format with timezone | |
var moment_format = 'YYYY-MM-DD HH:mm:ss zz'; // moment.js LDML format for parsing date strings | |
/** | |
* Convert a Javascript Date into node-time wrapper with the appropriate timezone. |
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
Taken from TJ Holowaychuk: http://tjholowaychuk.com/post/26904939933/git-extras-introduction-screencast | |
Added to ~/.bash_aliases | |
alias gd="git diff | subl" | |
alias ga="git add" | |
alias gaa="git add --all" | |
alias gbd="git branch -D" | |
alias gst="git status" | |
alias gca="git commit -a -m" | |
alias gm="git merge --no-ff" |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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
Copyright (c) 2015, Shahar Evron | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, |
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
// --- Dependancies --- | |
var _ = require('underscore'); | |
var mongoose = require('mongoose'); | |
// Any function that makes an update to a mongoose model that has an Array field can | |
// use this to catch version errors, and retry the update at most two times | |
var catchVersionErr = function () { | |
var updateFunc, callback, context, args = _.toArray(arguments); | |
context = args.shift(); |
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
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc | |
index 88df062..5adbc2e 100644 | |
--- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc | |
+++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc | |
@@ -14,7 +14,7 @@ | |
namespace { | |
// Max number of most recently used folders. | |
-const size_t kMaxMRUFolders = 5; | |
+const size_t kMaxMRUFolders = 20; |
the goal: to do fast virtual host routing, e.g. to have a single process on a machine listening on port 80 and proxying data based on HTTP Host to other non-port-80 web processes on the same machine
many people use nginx for this because nginx is faster than node is currently for data-heavy applications (see below)
they use the JS proxies from https://github.com/substack/bouncy/tree/master/bench
OlderNewer