Skip to content

Instantly share code, notes, and snippets.

View efazati's full-sized avatar
🎯
Focusing

Mohammad Efazati efazati

🎯
Focusing
View GitHub Profile
@efazati
efazati / title.py
Created January 4, 2013 10:21
flask title decorator, set title easy and simple
from functools import wraps
def title(title=None):
def decorator(f):
@wraps(f)
def decorated_function(*args, **kwargs):
g.page_title = title
return f(*args, **kwargs)
return decorated_function
@efazati
efazati / router.js
Created September 10, 2012 08:25
router
router = {};
router.hashchange = {
"requstables": [],
'add': function (regex, requstable) {
router.hashchange.requstables.push({'regex': regex, 'requstable': requstable});
},
'handler': function () {
for (var i = 0; i < router.hashchange.requstables.length; i++) {
var r = router.hashchange.requstables[i];
@efazati
efazati / zshrc
Created July 26, 2012 01:44
my zsh rc code
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#