Skip to content

Instantly share code, notes, and snippets.

View kilhage's full-sized avatar
🚀

Emil Kilhage kilhage

🚀
View GitHub Profile
@vlasky
vlasky / debugeventemitter.js
Last active May 30, 2020 11:04
Debugging code to help track down events that cause EventEmitter memory leaks in Node.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
cmourizard / SugarElasticsearchConfgWithAsciifolding.php
Created August 13, 2015 12:42
Elasticsearch configuration to enable asciifolding
<?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(
'lowercase',
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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

@chicks
chicks / DB2_Install_Steps.sh
Last active December 8, 2018 13:04
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 \
numactl
# Update Kernel Parameters (http://ibm.co/1czEKb4)
@joes
joes / git-pre-commit-php.rb
Created August 17, 2011 08:46
git pre-commit hook with php syntax checking and more
#!/usr/bin/env ruby
#
# Author: Joe Siponen <joe.siponen@gmail.com>
#
# 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
matthewmccullough / git-deletealltags.bsh
Created April 1, 2011 20:29
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done