Skip to content

Instantly share code, notes, and snippets.

@bastman
bastman / crowdparkRpc.js
Created November 19, 2012 11:34
crowdparkRpc js api client
/**
* crowdparkRpc.callApi('AppJsonRpc', 'Foo.bar',[1,2,3], function(response){console.log("response=",response)})
* @desc rpc client namespace
* @type {Object}
*/
var crowdparkRpc = {
_initialized: false,
url: '',
loggerFunction: null,
baseParams: {},
@bastman
bastman / BootstrapExample.php
Created November 20, 2012 14:34
PHP Bootstrap Errorhandling Example
<?php
/**
* Created by JetBrains PhpStorm.
* User: seb
* Date: 11/20/12
* Time: 2:09 PM
* To change this template use File | Settings | File Templates.
*/
namespace BootstrapExample;
@bastman
bastman / index.php
Created November 20, 2012 15:29
PHP Symfony2 ErrorHandler Example
<?php
/**
* Created by JetBrains PhpStorm.
* User: seb
* Date: 11/20/12
* Time: 4:10 PM
* To change this template use File | Settings | File Templates.
*/
require dirname(__FILE__).'/ErrorHandler.php';
@bastman
bastman / ErrorHandler.php
Created November 20, 2012 17:28
PHP ErrorHandler Example: Extended Symfony2 AND Custom Errors
<?php
/**
* Created by JetBrains PhpStorm.
* User: seb
* Date: 11/20/12
* Time: 4:05 PM
* To change this template use File | Settings | File Templates.
*/
namespace Symfony\Component\HttpKernel\Debug;
class ErrorHandler
@bastman
bastman / foo.php
Created November 25, 2012 12:07
Bootstrapping prototype
class Bootstrap
{
// PROTOTYPE. EXPERIMENTAL. BUGGY!
protected $_exceptionHandler;
protected $_errorHandler;
protected $_shutdownHandler;
protected $_onException;
@bastman
bastman / deploy.sh
Created November 29, 2012 06:59
deploy.sh
#!/bin/bash
#==============================================================================
#
# Script for automated deployments.
#
# This system expects at least the following directories to exists:
#
# * ../../temp
# * ../../transfer
# * ../../testing
@bastman
bastman / deployw9.sh
Created November 29, 2012 07:01
deployw9
#!/bin/bash
CMD_DIR=`dirname $0`
ssh [email protected] '
cd deploy ;
./sync_app.sh'
exit
@bastman
bastman / deploylv.sh
Created November 29, 2012 07:08
deploylv.sh
#!/bin/bash
echo "#########################################################"
echo "# WARNING: YOU ARE ABOUT TO UPDATE THE __LIVE__ SYSTEM! #"
echo "#########################################################"
echo
echo -n "Please type in YES to continue: "
read CHECK
@bastman
bastman / nginx.rb
Created December 1, 2012 07:18 — forked from mranallo/nginx.rb
NGINX with SPDY
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
# url 'http://nginx.org/download/nginx-1.2.3.tar.gz'
# sha1 '98059ae08ebbfaaead868128f7b66ebce16be9af'
url 'http://nginx.org/download/nginx-1.3.5.tar.gz'
sha1 'ce0245295f23a54f10d916eb6b7b34469d0618a1'
devel do
@bastman
bastman / GenericSingleton.php
Last active December 14, 2015 04:49
GenericSingleton in PHP
<?php
class A1 {
/**
* @var array
*/
private static $instanceDictionary = array();
/**