Skip to content

Instantly share code, notes, and snippets.

View rkaldung's full-sized avatar
🎯
Removing dust from the grey market

Roy Kaldung rkaldung

🎯
Removing dust from the grey market
View GitHub Profile
anonymous
anonymous / gist:851600
Created March 2, 2011 19:50
curl -XPUT http://localhost:9200/test_index/ -d '
{
"index": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "nGram",
"filter": ["lowercase", "snowball"]
},
@hjr3
hjr3 / Vagrantfile
Created August 24, 2012 23:40
Standard PHP vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos64-min"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://dl.dropbox.com/u/9227672/CentOS-6.0-x86_64-netboot-4.1.6.box"
@chartjes
chartjes / gist:3552838
Created August 31, 2012 13:46
Small sample lesson on mocking database operations
MOCKING DATABASE OPERATIONS
===========================
In our webreg example, we refactored some code so that we could
pass in our database object instead of creating it inside. Let's
push that further and show a slightly advanced usage of a mock
object.
So let's rework our Franchise test to use a mocked database connection.
@mbeijen
mbeijen / otrs.AddCustomer2Group.pl
Created September 9, 2013 05:48
Script to add customers to customer groups.
#!/usr/bin/perl
# --
# bin/otrs.AddCustomer2Group.pl - Add Customer to a Group
# Copyright (C) 2001-2013 OTRS AG, http://otrs.com/
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
@twtw
twtw / backup-ror.service
Last active April 12, 2017 14:34
using rvm and create ruby app startup script at systemd
# create systemd service file for rails 2.3.x startup
[Unit]
Description=rails 2.3.x web server
[Service]
Type=simple
RemainAfterExit=yes
User=username
PIDFile=/home/username/WEBSERVER/tmp/pids/thin.pid
WorkingDirectory=/home/username/WEBSERVER
@manchuck
manchuck / pre-commit
Last active September 19, 2017 16:34
This is a ZF2 precommit hook that runs Lint, Mess Detector, Code sniffer then classmap builder on commit
#!/bin/sh
echo
exec powershell.exe -ExecutionPolicy RemoteSigned -File '.\.git\hooks\pre-commit-hook.ps1'
exit
@roidrage
roidrage / wrap.rb
Last active May 3, 2018 04:46
A simple wrapper that forks off a child and prints out a progress dot every X seconds
#!/usr/bin/env ruby
pid = Kernel.fork do
`#{ARGV.join(" ")}`
exit
end
trap(:CHLD) do
print "\n"
exit
global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
@stbuehler
stbuehler / open-xchange-nginx.conf
Created July 9, 2016 13:58
Open-Xchange nginx config
# route balancing only in commercial edition...
#map $cookie_JESSIONID $route_cookie1 {
# ~.+\.(?P<route>\w+)$ $route;
#}
#map $cookie_jsessionid $route_cookie2 {
# ~.+\.(?P<route>\w+)$ $route;
#}
#map $request_uri $route_uri1 {
# ~JSESSIONID=.+\.(?P<route>\w+)$ $route;
#}
@mardix
mardix / php-cs-fixer-pre-commit.php
Created September 4, 2012 17:06
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*