Skip to content

Instantly share code, notes, and snippets.

View JackLeo's full-sized avatar

Domantas Jackūnas JackLeo

View GitHub Profile
@JackLeo
JackLeo / git_combine
Created March 18, 2014 15:03
simple and crude script to combine few repos to one on master branch
#!/bin/bash
if [ ! $# -gt 2 ]; then
echo "Usage: ./git_combine.sh new_repo_folder repo_folder repo_folder ..."
exit
fi
if [ ! -d $1 ]; then
mkdir $1
fi
@JackLeo
JackLeo / config2object.py
Last active December 11, 2015 13:18
Converts configparser config to object with attributes relative to config For example config: [test] foo=bar will become: settings.TEST_FOO = 'bar'
import os
import ConfigParser
class Settings(object):
pass
def boolify(item):
return {'True': True, 'False': False}[item]
@JackLeo
JackLeo / activecollab2openproject.py
Last active October 20, 2019 23:13
Active Collab migration to Open Project
import json
import urllib
import urllib2
import xml.dom.minidom
# AC: OP
project_slugs = {
'tu-munich': 'new-project',
}
@JackLeo
JackLeo / iframe_middleware.py
Created December 22, 2011 17:11 — forked from krikulis/iframe_middleware.py
Django IFrame session Safari FIX
from django.http import HttpResponse
from django.conf import settings
SESSION_COOKIE_NAME = getattr(settings, 'SESSION_COOKIE_NAME')
class SafariIFrameFixMiddleware(object):
"""
Middleware fixes sessions with Safari browser in iframes