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"]
},
@p4ul
p4ul / teamviewer.bat
Created October 12, 2011 22:25
use this with my teamviewer:// protocol hander
@echo off
REM place this in C:\ and install teamviewer.reg below. Then you should be able to
REM openteamviewers from the webbrowser with teamviewer://1234
set protocolString=%1
REM uncomment below for testing
REM set protocolString="teamviewer://795143153"
set protocolString=%protocolString:"=%
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 2, 2024 13:56
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@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.
@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)
*
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 2, 2024 22:20
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@diemuzi
diemuzi / README
Created October 7, 2012 19:44
Apache 2.2.x / 2.4.x FPM Configuration
This configuration is a working copy which I have tested on Apache 2.2.x and 2.4.x
I highly recommend you use this version of mod_fastcgi as it works with Apache 2.4.x, fastcgi.com version does not!
https://github.com/ByteInternet/libapache-mod-fastcgi
The fastcgi.com version is 2.4.6, the version I am recommending registers as 2.4.7
To patch mod_fastcgi for use with Apache 2.4.x look at the debian/patches folder. It's not specific to Debian OS so don't let that fool you. I personally use Archlinux.
Of course to compile mod_fastcgi: