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 replace ($text, array $replace) { | |
// @see: http://www.php.net/manual/en/function.strtr.php#106282 | |
$text = "".$text; | |
$keys = array_keys($replace); | |
$length = array_combine($keys, array_map('strlen', $keys)); | |
arsort($length); | |
$array[] = $text; |
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 | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: seb | |
* To change this template use File | Settings | File Templates. | |
*/ | |
class Micro_Lib_Db_Mysql_Pdo_Exception extends Exception | |
{ | |
/** |
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
package de.basilicom.utils | |
{ | |
/** | |
* @requires: JSON on javascript-side, e.g: JSON2.js | |
* @description pimp flash.external.ExternalInterface | |
* @author seb | |
*/ | |
import com.adobe.serialization.json.JSON; | |
import flash.external.ExternalInterface; | |
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
http://sebschmidt.tumblr.com/post/7920812905/nginx-how-to-setup-tornado-and-apache-on-a-virtual | |
http://stackoverflow.com/questions/5375220/how-do-i-stop-tornado-web-server | |
http://stackoverflow.com/questions/1447342/how-can-i-start-multiple-tornado-server-intances-in-multiple-ports | |
./demos/blog/blog.py --port=8889 |
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 | |
/** | |
* Lib_Utils_Base64 | |
* | |
* Array Utils | |
* | |
* @category basilicom | |
* @package Lib_Utils | |
* |
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
public function parseRpcMethod($rpcMethod) | |
{ | |
$rpcMethod = '' . strtolower(trim('' . $rpcMethod)); | |
$parts = (array)explode('.', $rpcMethod); | |
$_parts = array(); | |
foreach($parts as $part) { | |
$part = ''. ucfirst(trim(''.$part)); | |
$_parts[] = $part; | |
} |
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/sh | |
open -a "TextMate" $1 |
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
_design/migrating/sync_machine_logic | |
function (doc, meta) { | |
if (meta.type == "json") { | |
// If the document is JSON, sort by the schema | |
var splitId = meta.id.split(":"); | |
if(splitId[0] == 'game' && splitId[1] == 'logic'){ | |
emit(splitId[0], null); | |
} |
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
_design/migrating/sync_machine_logic | |
function (doc, meta) { | |
if (meta.type == "json") { | |
// If the document is JSON, sort by the schema | |
var splitId = meta.id.split(":"); | |
if(splitId[0] == 'game' && splitId[1] == 'logic'){ | |
emit(splitId[0], null); | |
} |
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 | |
/** | |
* a demo of current issues when working with chaining | |
* Looking forward to phpstorm 6 | |
* | |
* @see: http://youtrack.jetbrains.com/issue/WI-2225 | |
* | |
* | |
* file: chaining.php | |
* run: php chaining.php |