Skip to content

Instantly share code, notes, and snippets.

View charlax's full-sized avatar

Charles-Axel Dein charlax

View GitHub Profile
@charlax
charlax / myapp.model.__init__.py
Created September 7, 2012 08:35
Transaction and scopedsession (SQLAlchemy & Pyramid)
from sqlalchemy.orm import sessionmaker, scoped_session
...
Session = scoped_session(sessionmaker())
# When using scoped_session, Session and Session() expose the same .commit() .query() .add() etc. methods.
...
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@charlax
charlax / gaul-mac-os-x.patch
Created October 7, 2011 20:59
Patch to install gaul on Mac Os X
diff --git a/util/gaul/gaul_util.h b/util/gaul/gaul_util.h
index d81df51..74511d9 100755
--- a/util/gaul/gaul_util.h
+++ b/util/gaul/gaul_util.h
@@ -175,6 +175,7 @@ typedef short _Bool;
#if HAVE__BOOL != 1
typedef short _Bool;
#endif
+typedef short _Bool;
@charlax
charlax / pgrouting-mac-os-x.patch
Created October 7, 2011 20:40
Patch to install pgrouting on Mac Os X
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d6612c..852fd1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,7 +64,9 @@ OPTION(WITH_DD "Build Driving distance library" OFF)
IF(UNIX)
SET(LIBRARY_INSTALL_PATH ${LIB_DIR})
- SET(SQL_INSTALL_PATH /usr/share/postlbs)
+ if(NOT SQL_INSTALL_PATH)
@charlax
charlax / supervisord.conf
Created September 13, 2011 02:49
To save in /etc/init/supervisord.conf
description "supervisord"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /usr/local/bin/supervisord --nodaemon --configuration /etc/supervisord.conf
-- ResetPrototype
--
-- Copyright (c) 2011, Charles-Axel Dein
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
--
-- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE