Skip to content

Instantly share code, notes, and snippets.

View vjousse's full-sized avatar

Vincent Jousse vjousse

View GitHub Profile
@vjousse
vjousse / sqlalchemy_conftest.py
Created February 20, 2018 14:35 — forked from kissgyorgy/sqlalchemy_conftest.py
Python: py.test fixture for SQLAlchemy test in a transaction, create tables only once!
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from myapp.models import BaseModel
import pytest
@pytest.fixture(scope='session')
def engine():
return create_engine('postgresql://localhost/test_database)
@vjousse
vjousse / keybase.md
Created October 8, 2017 08:46
keybase.md

Keybase proof

I hereby claim:

  • I am vjousse on github.
  • I am vjousse (https://keybase.io/vjousse) on keybase.
  • I have a public key ASBJmFsbYUzduOMMeVx61F3Dw1gjGcQM8ejgI01Tl3ZUuQo

To claim this, I am signing this object:

@vjousse
vjousse / redirect2nginx.py
Created September 11, 2013 10:23
Simple django command to output django_redirect redirections to nginx format
from django.core.management.base import BaseCommand, CommandError
from django.contrib.redirects.models import Redirect
class Command(BaseCommand):
help = 'Print nginx redirections'
def handle(self, *args, **options):
for redirect in Redirect.objects.all():
self.stdout.write('rewrite ^%s$ %s permanent;' % (redirect.old_path, redirect.new_path))
<?php
// change this with the actual path you cloned sf2 to
$sf2_path = '~/symfony/src';
use Symfony\Foundation\ClassLoader;
use Symfony\Components\Console\Application;
require_once $sf2_path.'/Symfony/Foundation/ClassLoader.php';