Skip to content

Instantly share code, notes, and snippets.

View theDisco's full-sized avatar

Wojciech Gancarczyk theDisco

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thedisco on github.
  • I am wojtyna (https://keybase.io/wojtyna) on keybase.
  • I have a public key ASCGzabKf-rC-ZaQ2m5c4sWzSAOfEV0EIxZP6dqZa4nWNAo

To claim this, I am signing this object:

@theDisco
theDisco / gist:c8b473a0270fa3d10768
Created November 26, 2014 11:34
Collection Adapter for Phalcon
<?php
class MyModel
{
private static $data;
public static function setData(array $data)
{
self::$data = $data;
}
@theDisco
theDisco / IndexController.php
Created November 5, 2012 21:16
Custom Tag for Phalcon
<?php
namespace App\Frontend\Controllers;
use App\Frontend\Models\Users;
class SessionController extends BaseController
{
public function createAction ()
{
@theDisco
theDisco / Vagrantfile
Created September 17, 2012 10:05
Vagrant setup for phalcon projects
Vagrant::Config.run do |config|
config.vm.box = "squeeze32"
config.vm.network :hostonly, "192.168.50.100"
config.vm.forward_port 80, 8080
end
@theDisco
theDisco / supervisor
Created September 11, 2012 08:04
init.d for supervisord
#! /bin/bash -e
# Taken and corrected from:
# http://paste.roguecoders.com/p/ff16aa631b84c579033e10fb7d49deb6.txt
SUPERVISORD=/usr/local/bin/supervisord
PIDFILE=/var/run/supervisord.pid
OPTS="-c /etc/supervisord/supervisord.conf"
test -x $SUPERVISORD || exit 0
@theDisco
theDisco / install.sh
Created June 7, 2012 18:35
Oracle Java on Ubuntu 12.04
#!/bin/sh
chmod +x jdk-6u32-linux-x64.bin
./jdk-6u32-linux-x64.bin
sudo mv jdk1.6.0_32 /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
@theDisco
theDisco / strace
Created April 23, 2012 17:24
strace apache
strace $(pidof apache2 | sed 's/\([0-9]*\)/\-p \1/g')
@theDisco
theDisco / error.php
Created April 13, 2012 08:46
error handling
<?php
// Original http://codereview.stackexchange.com/questions/10846/could-this-php-error-exception-handling-be-better
error_reporting(~0);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
/* Set the error handler. */
@theDisco
theDisco / setup.sh
Created April 2, 2012 18:31
Setting up rails in vagrant
#!/bin/bash
sudo apt-get install build-essential zlib1g-dev git-core vim curl mysql-server libmysql-ruby libmysqlclient-dev subversion
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source .bash_profile
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build/
sudo ./install.sh
@theDisco
theDisco / zshrc
Created April 2, 2012 07:30
My zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git svn phing)
source $ZSH/oh-my-zsh.sh
# History
HISTFILE=~/.zshistory