Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import markdown
# --------------- CONSTANTS YOU MIGHT WANT TO MODIFY -----------------
DEFAULT_HILITER = 'pygments' # one of 'enscript', 'dp', or 'pygments'
try:
TAB_LENGTH = markdown.TAB_LENGTH
except AttributeError:
TAB_LENGTH = 4
# -*- coding: utf-8
# Copyright (c) 2009 Piotr Husiatyński. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/usr/bin/env python
# -*- coding: utf-8
#Copyright (c) 2009 Piotr Husiatyński.
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software"), to deal in the Software without
#restriction, including without limitation the rights to use,
#copy, modify, merge, publish, distribute, sublicense, and/or sell
# -*- coding: utf-8 -*-
from twisted.internet import reactor
from twisted.web import client
from twisted.internet.defer import DeferredList
def check_url(url, status_handler):
def _page_fail(reason):
diff --git a/git.c b/git.c
index 11544cd..88e9ac2 100644
--- a/git.c
+++ b/git.c
@@ -4,6 +4,10 @@
#include "quote.h"
#include "run-command.h"
+#define min_flag_size(ARGC) ((ARGC) * 32)
+#define ENV_CURRENT_CMD "GIT_CURRENT_CMD"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import gtk
def sig_suspend(button, *args, **kwds):
gtk.main_quit()
os.system('pm-suspend')
@husio
husio / gitvimdiff.sh
Created December 12, 2009 20:16
Git diff for branches using vimdiff
#!/usr/bin/env bash
function show_help_and_exit {
echo -e "Usage\n\t$1 <master branch> <branch to merge>\n"
exit 2
}
[[ $# -eq 2 ]] || show_help_and_exit
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup, Extension
module = Extension('sqlitebck',
sources=['src/sqlitebck.c', ],
libraries=['sqlite3', ])
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
import os
import psycopg2
import datetime
import multiprocessing
# -*- coding: utf-8 -*-
from django.db import models
class LtreeField(models.CharField):
"""Field implementation of PostgreSQL ltree type"""
def __init__(self, *args, **kwds):
super(LtreeField, self).__init__(max_length=128, *args, **kwds)