Skip to content

Instantly share code, notes, and snippets.

Vincent Jousse vjousse

Block or report user

Report or block vjousse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vjousse
vjousse / sqlalchemy_conftest.py
Created Feb 20, 2018 — forked from kissgyorgy/sqlalchemy_conftest.py
Python: py.test fixture for SQLAlchemy test in a transaction, create tables only once!
View sqlalchemy_conftest.py
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)
View 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 Sep 11, 2013
Simple django command to output django_redirect redirections to nginx format
View redirect2nginx.py
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))
View git-conventions.markdown
View sf2cli.php
<?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';
You can’t perform that action at this time.