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 | |
# based on: https://gist.github.com/ihor/3829571/raw/911dc06391ab7fa4e7ac152594ff2bb23ae40869/supervisor | |
DAEMON=/usr/local/bin/supervisord | |
OPTS='' | |
#OPTS='-c /usr/local/etc/supervisor/supervisord.conf' | |
NAME=supervisor | |
DESC=supervisor | |
PID_FILE='/tmp/supervisord.pid' |
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 | |
declare(ticks = 300); | |
pcntl_signal(SIGTERM, "signal_handler"); | |
pcntl_signal(SIGINT, "signal_handler"); | |
function signal_handler($signal) { | |
var_dump(array('signal'=>$signal)); |
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 | |
execAndLog () | |
{ | |
local logFile=./logfile_$( date +%d%m%y%H%M).txt | |
if [ $1 == 'cd' ] | |
then | |
echo "cd $2 ..." 2>&1 | tee -a $logFile | |
cd $2 | |
echo " --> you are here: $(pwd)" 2>&1 | tee -a $logFile |
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 | |
error_reporting(E_ALL | E_STRICT); | |
ini_set('display_errors', true); | |
/** | |
* @param $errno | |
* @param $errstr | |
* @param $errfile | |
* @param $errline | |
* @throws ErrorException |
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
project.environment.name=local | |
project.name=${phing.project.name} | |
dir.build_xml=${project.basedir} | |
project.host.default=${project.environment.name}.${project.name}.mydomain.com | |
dir.project=${dir.build_xml}/../../.. |
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
CrowdparkRpc = { | |
invokeRpc: function (httpMethod, url, method, params, baseParams, callback) { | |
var method = '' + method; | |
if (!params) { | |
var params = []; | |
} | |
var rpc = { | |
method: method, | |
params: params |
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
'use strict'; | |
angular.module('CrowdparkJsonRpc').provider( | |
'CrowdparkJsonRpcApiClient', | |
function (){ |
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
/** | |
* @param string $table | |
* @param array $rowInsert | |
* @param array $rowUpdate | |
* @return array | |
*/ | |
function createSqlInsertIntoTableOnDuplicateKeyUpdate($table, $rowInsert, $rowUpdate) | |
{ | |
$insertColumnTokens = array(); | |
$insertValueTokens = array(); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 class ClientFactory { | |
public static <T extends Client> T createClient(Class<T> clientClass, String host, Integer port) | |
{ | |
try { | |
Constructor<T> constructor = clientClass.getConstructor( | |
String.class, Integer.class | |
); | |
T client = constructor.newInstance( |