Skip to content

Instantly share code, notes, and snippets.

View teki's full-sized avatar

Bela Babik teki

View GitHub Profile
@teki
teki / gist:4967
Created August 11, 2008 23:28
reviewboard midified LDAP backend
class LDAPBackend:
"""
Authenticate against a user on an LDAP server.
"""
def authenticate(self, username, password):
try:
import ldap
ldapo = ldap.initialize(settings.LDAP_URI)
ldapo.set_option(ldap.OPT_PROTOCOL_VERSION, 3)
Index: include/feedcreator.class.php
===================================================================
--- include/feedcreator.class.php (revision 635)
+++ include/feedcreator.class.php (working copy)
@@ -325,6 +325,7 @@
@teki
teki / gist:5189
Created August 13, 2008 03:11
websvn rss guid permalink fix
Index: include/feedcreator.class.php
===================================================================
--- include/feedcreator.class.php (revision 635)
+++ include/feedcreator.class.php (working copy)
@@ -325,6 +325,7 @@
@teki
teki / vimrc
Last active December 29, 2015 14:59
set nocompatible
" load plugins if they are available
let s:myvimrc = expand("~/myenv/vim_local/vimrc")
let s:hasplugins = filereadable(s:myvimrc)
if s:hasplugins
set runtimepath=~/myenv/vim_local,$VIMRUNTIME
filetype on
filetype off
@teki
teki / ko
Last active January 2, 2016 18:29
editor
#!/bin/bash
IFS=$'\n'
OS=$(uname)
[ -z "$VISRVNAME" ] && VISRVNAME="ko"
[ -f "$MBE/vim/vimrc" ] && VIMPARAMS=-u "$MBE/vim/vimrc"
if [ "$OS" == "Darwin" ]; then
if [ -h /Applications/MacVim.app ] || [ -d ~/Applications/MacVim.app ] ; then
if [ "$1" == "--printvimbin" ]; then
echo mvim
@teki
teki / vimrc
Last active January 2, 2016 18:38
vimrc
set nocompatible
" load plugins if they are available
let s:myvimrc = expand($MBE . "/vim/vimrc")
let s:hasplugins = filereadable(s:myvimrc)
if s:hasplugins
filetype on
filetype off
set rtp+=$MBE . "/vim/bundle/vundle"
@teki
teki / PrimitivePic_bg.30m.py
Last active September 23, 2019 16:54
Use latest pic as background from https://twitter.com/PrimitivePic
#!/usr/bin/python
# use it with https://github.com/matryer/bitbar
import os
import re
import subprocess
import tempfile
import time
import urllib2
TW_URL = 'https://twitter.com/PrimitivePic'
@teki
teki / devworld2016.md
Last active September 27, 2016 01:29
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import shutil
import sys
import subprocess
import urllib2
#!/usr/bin/env python
import json
import sys
import re
import subprocess
incdirs = set()
with open("compile_commands.json") as fp: