Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
// The `quickEach` method will pass a non-unique jQuery instance | |
// to the callback meaning that there will be no need to instantiate | |
// a fresh jQuery instance on each iteration. Most of the slow-down | |
// inherent in jQuery's native iterator method (`each`) is the constant | |
// need to have access to jQuery's methods, and so most developers | |
// see constructing multiple instances as no issue... E.g. | |
// $(...).each(function(){ $(this)... $(this)... $(this)... }); | |
// A better approach would be `quickEach`. | |
jQuery.fn.quickEach = (function(){ |
var xmpp = require('../lib/node-xmpp'); | |
var sys = require("sys"); | |
var redis = require("redis-node"); | |
var redispub = redis.createClient(); | |
var redissub = redis.createClient(); | |
var port = parseInt(process.argv[process.argv.length - 1]); | |
if(isNaN(port)) { | |
console.log("You need to supply a port!") |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
%% mod_msg_filter allows the filtering of "message" | |
%% stanzas across an HTTP service. The URL of the | |
%% service must be passed as part of the module's | |
%% configuration. Both JIDs and their resources are | |
%% passed as part of the query string and the result | |
%% is expected to be one of: | |
%% | |
%% <status value="denied"> | |
%% <stanza1><error/></stanza1> | |
%% <stanza2><error/></stanza2> |
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js | |
(function( jQuery ) { | |
if ( window.XDomainRequest && !jQuery.support.cors ) { | |
jQuery.ajaxTransport(function( s ) { | |
if ( s.crossDomain && s.async ) { | |
if ( s.timeout ) { | |
s.xdrTimeout = s.timeout; | |
delete s.timeout; |
function ej { | |
EJABBERD_HOME=/usr/local/ejabberd-commercial | |
EJABBERD_CTL=$EJABBERD_HOME/sbin/ejabberdctl | |
case "$1" in | |
restart) | |
$EJABBERD_CTL stop && $EJABBERD_CTL stopped; $EJABBERD_CTL start | |
;; | |
reload) | |
$EJABBERD_CTL update $2 |
--cluster-mode = false | |
config-type = --gen-config-all | |
--cluster-nodes = ip-10-66-2-93 | |
--debug=server,xmpp.impl,db | |
--user-db = derby | |
--admins = admin@ip-10-66-2-93 | |
--user-db-uri = jdbc:derby:/opt/tigase/tigasedb | |
--virt-hosts=ip-10-66-2-93,localhost | |
--comp-name-1=ext | |
--comp-class-1 = tigase.server.ext.ComponentProtocol |
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" | |
DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver" | |
#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2" | |
JAVA_HOME="/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64" | |
CLASSPATH="" | |
#JAVA_OPTIONS="${GC} ${ENC} ${DRV} -server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m " | |
JAVA_OPTIONS="${GC} ${ENC} ${DRV} -server -Xms200M -Xmx400M -XX:PermSize=64m -XX:MaxPermSize=512m -XX:MaxDirectMemorySize=256m " | |
TIGASE_CONFIG="etc/tigase.xml" | |
TIGASE_OPTIONS=" --property-file etc/init.properties" |
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
/** | |
* Author: Michael Weibel <michael.weibel@gmail.com> | |
* License: MIT | |
*/ | |
var passport = require('passport') | |
, StrategyMock = require('./strategy-mock'); | |
module.exports = function(app, options) { | |
// create your verify function on your own -- should do similar things as |