This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Router/DefaultPatternGenerationStrategy.php b/Router/DefaultPatternGenerationStrategy.php | |
index 2fe5dfb..714ea37 100755 | |
--- a/Router/DefaultPatternGenerationStrategy.php | |
+++ b/Router/DefaultPatternGenerationStrategy.php | |
@@ -66,6 +66,9 @@ class DefaultPatternGenerationStrategy implements PatternGenerationStrategyInter | |
// prefix with locale if requested | |
if (self::STRATEGY_PREFIX === $this->strategy | |
|| (self::STRATEGY_PREFIX_EXCEPT_DEFAULT === $this->strategy && $this->defaultLocale !== $locale)) { | |
+ if ($i18nPattern == '/') { | |
+ $i18nPattern = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR="$( builtin cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
[ "$VIRTUAL_ENV" != "$DIR/venv" ] && . $DIR/venv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR="$( builtin cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre_composer_script: | | |
memcached -d | |
sudo apt-get -y -q --force-yes install zlib1g-dev pkg-config libmemcached-dev | |
cd /tmp | |
wget https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz | |
tar zxvf 2.2.0.tar.gz | |
cd php-memcached-2.2.0 | |
phpize | |
./configure --disable-memcached-sasl | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD_THRESHOLD="2.0" | |
if [ $(echo $(cut -d" " -f2 /proc/loadavg) " > $LOAD_THRESHOLD" | bc -l) -eq 1 ]; then | |
echo "High load"; | |
else | |
echo "Low load"; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mdb-wc { | |
IFS_ORIG=$IFS; | |
IFS=$'\n'; | |
for t in `mdb-tables -1 "$1"` | |
do | |
echo $t; | |
mdb-export "$1" "$t" | wc; | |
done; | |
IFS=$IFS_ORIG; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Minimal CLI wrapper around phonenumbers library so that PHP can use it | |
Author: Kishore Kumar <[email protected]> | |
Usage: python ph.py <command> <args> | |
Commands: | |
help - Print this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Backup github issues | |
Input: Read from settings.py | |
Output: JSON data written to stdout | |
Usage: ./github-issues.py >xyz-issues.json | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function camelToTitle($camelStr) | |
{ | |
$intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/', | |
' $0', | |
$camelStr); | |
$titleStr = preg_replace('/(?!^)([[:lower:]])([[:upper:]])/', | |
'$1 $2', | |
$intermediate); |
NewerOlder