Skip to content

Instantly share code, notes, and snippets.

View onema's full-sized avatar
👾

Juan Manuel Torres onema

👾
View GitHub Profile
@onema
onema / graceful_int_handler.py
Created November 5, 2015 17:53 — forked from nonZero/graceful_int_handler.py
GracefulInterruptHandler
import signal
class GracefulInterruptHandler(object):
def __init__(self, sig=signal.SIGINT):
self.sig = sig
def __enter__(self):
self.interrupted = False
@onema
onema / nginx.conf
Created April 3, 2014 06:31 — forked from leon/nginx.conf
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@onema
onema / post.md
Created January 17, 2014 22:54 — forked from kbond/post.md

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@onema
onema / gist:6060077
Last active December 20, 2015 02:59 — forked from makasim/gist:3720535
Form PatchSubsciber for Symfony 2.3. This Form Event Subscriber will help prepare data for a PATCH request. It can be added in your CustomFormType::buildForm method.
<?php
namespace Acme\DemoBundle\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
/**
* Changes Form->submit() behavior so that it treats not set values as if they