Skip to content

Instantly share code, notes, and snippets.

daemon off;
error_log stderr;
events {
worker_connections 1024;
}
http {
# As suggested in http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
<?php namespace Initr\Services;
use Illuminate\Validation\Factory as LaravelValidator;
abstract class Validator
{
protected $validator;
protected $data = array();
@huglester
huglester / rc.d
Created March 18, 2014 22:09 — forked from jippi/rc.d
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
<?php
/* app/validators.php */
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
/*
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
<?php
Class ProjectsController Extends BaseController {
public function getNew(){
return dd(Sentry::getUserProvider()->createModel()
->join('throttle','throttle.user_id','=','users.id','left')
->where('throttle.banned',0)
->orWhere('throttle.banned',null)
->where('throttle.suspended',0)
sudo bash
cd /usr/local/lib
wget http://launchpad.net/gearmand/trunk/0.18/+download/gearmand-0.18.tar.gz
tar -xvzf gearmand-0.18.tar.gz
cd gearmand-0.18/
apt-get install libboost-program-options-dev uuid-dev libevent-dev build-essential g++ perf libcloog-ppl0
./configure && sudo make && sudo make install
ldconfig
@huglester
huglester / xvfb
Created May 28, 2013 07:16 — forked from jterrace/xvfb
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).