Skip to content

Instantly share code, notes, and snippets.

@DaveRandom
DaveRandom / file.php
Last active December 12, 2015 03:38
Simple file upload manager lib
<?php
namespace Upload;
class File implements IFile {
/**
* The meta data about the file (from the $_FILES array)
*
* @var array $uploadMeta
@defrag
defrag / gist:4547311
Created January 16, 2013 14:02
Beanstalkd command line process for listening to symfony2 bg jobs.
<?php
namespace PW\ApplicationBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Input\StringInput,
Symfony\Component\Console\Output\OutputInterface;
@mattattui
mattattui / deploy.sh
Created January 5, 2013 09:48
Simple default-safe rsync deployment script
#!/bin/bash
# Will add --dry-run unless the --go option is set. All other arguments passed to rsync (e.g. --delete)
SOURCE=.
DEST=example.com:/var/www/mysite
DRYRUN="--dry-run"
args=()
for var in "$@"
@brtriver
brtriver / BasicAuthControllerProvider.php
Created February 4, 2012 20:36
Simple Basic Auth Controller for Silex.
<?php
namespace Silex\Provider;
use Silex\Application;
use Silex\SilexEvents;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@bxt
bxt / RingBuffer.class.php
Created September 7, 2011 13:15
One-pointer Circular Buffer w/o overflow check and FIFO, using SplFixedArray
<?php
/**
* One-pointer Circular Buffer
*
* This comes without any overwrite
* checks or FIFO functionality.
* You'll need SPL.
*
* @author Bernhard Häussner
* @date 2011-09-07
# add your user to www-data and vise versa
sudo usermod -a -G www-data myusername
sudo usermod -a -G myusername www-data
# override umask in ~/.bashrc and /etc/init.d/apache2
umask 002
#restart