Skip to content

Instantly share code, notes, and snippets.

View enricofoltran's full-sized avatar

Enrico Foltran enricofoltran

View GitHub Profile
@prettyirrelevant
prettyirrelevant / app.py
Last active July 4, 2023 00:55
Using Huey with Flask using application factory. For configuration, follow the djhuey format
# Due to the flexible nature of Flask. This might be __init__.py
from .extensions import huey
def create_app():
app = Flask(__name__)
# add your configurations
# app.config.from_object("settings.local")
huey.init_app(app)
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@rduplain
rduplain / slides.md
Last active February 7, 2019 15:40
Use Werkzeug's web-based interactive debugger with Tornado.

Interactive Debugging in any Python Web Project

Ron DuPlain - PyOhio 2013

Turn this:

@stof
stof / gist:3473109
Created August 26, 2012 02:03
BoxFile to deploy a Symfony 2.1 app on Pagodabox
web1:
shared_writable_dirs:
- app/cache
- app/logs
- app/sessions
document_root: web
default_gateway: app.php
index_list: [app.php]
php_version: 5.3.10
php_extensions:
@enricofoltran
enricofoltran / .bashrc
Created February 9, 2012 13:15
show current git branch on bash
parse_git_branch()
{
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[01;34m\] \w\[\033[31m\]\$(parse_git_branch) \[\033[00m\]$\[\033[00m\] "
@enricofoltran
enricofoltran / Contact.php
Created December 19, 2011 07:54
Contact form with Zend Framework
<?php
/* /library/Square/Form/Contact.php */
class Square_Form_Contact extends Zend_Form
{
public function init()
{
<?php defined('SYSPATH') or die('No direct script access.');
/**
* User to user communication wrapper. Uses Swift Mailer for email transport.
*
* @package Communicate
* @category Base
* @author Woody Gilk <woody@wingsc.com>
* @copyright (c) 2010 Woody Gilk
* @license MIT
*/
<?php
/**
* Answer model is the class that represents single answer to the
* question. It handles all the operations with answer
*
* @package cevapbankasi
*/
class Model_Answer extends Model_Abstract {
public static function initialize(Jelly_Meta $meta)
<?php
class Model_Category extends Model_Abstract {
protected static $_path;
public static function initialize(Jelly_Meta $meta)
{
$meta->table('categories')
->name_key('title')
->sorting(array('materialized_path' => 'asc'))
->fields(array(
@fiee
fiee / fabfile.py
Created July 29, 2009 13:55 — forked from anonymous/gist:156623
fabric fabfile.py for deployment of django apps on Debian servers
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too