Skip to content

Instantly share code, notes, and snippets.


Emil Kilhage kilhage

View GitHub Profile
vlasky / debugeventemitter.js
Last active May 30, 2020
Debugging code to help track down events that cause EventEmitter memory leaks in Node.js
View debugeventemitter.js
//Is Node.js reporting warning messages like this?:
// "Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit"
//The following code will intercept calls to addListener() and on() and print the type of event and generate an Error exception
//With a stack trace to help you find the cause
var EventEmitter = require('events').EventEmitter;
const originalAddListener = EventEmitter.prototype.addListener;
cmourizard / SugarElasticsearchConfgWithAsciifolding.php
Created Aug 13, 2015
Elasticsearch configuration to enable asciifolding
View SugarElasticsearchConfgWithAsciifolding.php
$sugar_config['full_text_engine']['Elastic']['index_settings']['default']['index'] = array(
'analysis' => array(
'analyzer' => array(
'core_email_lowercase' => array(
'type' => 'custom',
'tokenizer' => 'uax_url_email',
'filter' => array(
soheilhy /
Last active Aug 7, 2020
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

chicks /
Last active Dec 8, 2018
Sugar and DB2 on CentOS 6.4
# Disable SELinux
echo 0 > /selinux/enforce
perl -pi -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# Install required packages
yum install pdksh compat-libstdc++-33 compat-libstdc++-33.i686 libaio libaio.i686 \
pam-1.1.1-17.el6.x86_64 pam-1.1.1-17.el6.i686 nfs-utils openssh-clients \
# Update Kernel Parameters (
joes / git-pre-commit-php.rb
Created Aug 17, 2011
git pre-commit hook with php syntax checking and more
View git-pre-commit-php.rb
#!/usr/bin/env ruby
# Author: Joe Siponen <>
# A hook script to verify that only syntactically valid php code is commited.
# This hook also stops files containing the string '[[NOCOMMIT' from being committed.
# This provides an mechanism allowing you to protect yourself from committing
# code you have added for debugging purposes by adding the string '[[NOCOMMIT'
# near the relevant section of code.
matthewmccullough / git-deletealltags.bsh
Created Apr 1, 2011
Script to delete all tags both locally and remotely
View git-deletealltags.bsh
for t in `git tag`
git push origin :$t
git tag -d $t
You can’t perform that action at this time.