Skip to content

Instantly share code, notes, and snippets.

View hberberoglu's full-sized avatar

Huseyin Berberoglu hberberoglu

View GitHub Profile
@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@GABeech
GABeech / haproxy.cfg
Created August 21, 2014 18:35
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@anova
anova / turkish-capitalize-words.js
Last active June 28, 2022 08:45
Capitalize, lowercase, uppercase for Turkish alphabet.
//http://stackoverflow.com/a/1026087/181295
String.prototype.turkishUpperCase = function () {
return this.replace(/ğ/g, 'Ğ')
.replace(/ü/g, 'Ü')
.replace(/ş/g, 'Ş')
.replace(/ı/g, 'I')
.replace(/i/g, 'İ')
.replace(/ö/g, 'Ö')
.replace(/ç/g, 'Ç')
.toUpperCase();
@olimortimer
olimortimer / gist:6775681
Created October 1, 2013 08:56
JS: Select2 FastClick Fix
$('#select2').select2({
data: data,
// Add our 'needsclick' to each item, so FastClick doesn't get applied
formatResult: function(result, container, query, escapeMarkup) {
container.addClass('needsclick');
return result.text;
}
});
@kloon
kloon / deploy.sh
Last active December 4, 2020 14:05
Github to WordPress.org plugin repo deploy
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="camptix-payfast-gateway"
CURRENTDIR=`pwd`
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@scribu
scribu / plugin-deploy.sh
Created August 4, 2011 12:18
Plugin deploy
#!/usr/bin/env bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/$DIR_NAME/$BRANCH
@karmi
karmi / elastic_search_ngram_analyzer_for_urls.sh
Created May 24, 2011 15:32
NGram Analyzer in ElasticSearch
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/ngram_test
curl -X PUT localhost:9200/ngram_test -d '
{
"settings" : {
"index" : {
"analysis" : {