This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Migration Tool for Redmine issue and time entry comments from SVN revisions to Git (i.e. r1234 => commit:abcdef789) | |
# ============================== | |
# (c) 2009 Christoph Olszowka & Sebastian Georgi, Capita Unternehmensberatung | |
# | |
# We used this when we migrated two of our main repositories from svn to git (see http://gist.github.com/139478) | |
# and wanted to have our revision links in Redmine reflect that change, too. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ['2.3.8', '2.3.9', '2.3.10', '2.3.11'].include?(Rails.version) && Gem.available?('mongrel', '~>1.1.5') && self.class.const_defined?(:Mongrel) | |
# Pulled right from latest rack. Old looked like this in 1.1.0 version. | |
# | |
# def [](k) | |
# super(@names[k] ||= @names[k.downcase]) | |
# end | |
# | |
module Rack | |
module Utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Migration tool from SVN to git | |
# ============================== | |
# (c) 2009 Christoph Olszowka, Capita Unternehmensberatung | |
# | |
# This is not meant for usage in an actual shell script - you're better off running | |
# each individual block (marked by the comments) separately and check the output to see if everything | |
# went right - this is more a writeup of the required steps so I can remember them rather than a | |
# shoot-and-forget-solution. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Migration Tool for Redmine issue and time entry comments from SVN revisions to Git (i.e. r1234 => commit:abcdef789) | |
# ============================== | |
# (c) 2009 Christoph Olszowka & Sebastian Georgi, Capita Unternehmensberatung | |
# | |
# We used this when we migrated two of our main repositories from svn to git (see http://gist.github.com/139478) | |
# and wanted to have our revision links in Redmine reflect that change, too. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off. | |
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request | |
*/ | |
function getCookie(name) | |
{ | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_fab() | |
{ | |
_fab_commands=$(fab --shortlist) | |
local cur prev | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
COMPREPLY=( $(compgen -W "${_fab_commands}" -- ${cur}) ) | |
case "${COMPREPLY}" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# settings convention from: | |
# https://code.djangoproject.com/wiki/SplitSettings#SettingInheritancewithHierarchy | |
import os, pwd | |
# certain keys we want to merge instead of copy | |
merge_keys = ('INSTALLED_APPS', 'MIDDLEWARE_CLASSES') | |
def deep_update(from_dict, to_dict): | |
for (key, value) in from_dict.iteritems(): | |
if key in to_dict.keys() and isinstance(to_dict[key], dict) and isinstance(value, dict): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Celery tasks that batch a job with many tasks into smaller work sets. | |
The problem I'm attempting to solve is one where a job comprised of many | |
tasks (say 100) will snub out a job comprised of only a few tasks (say 5). It | |
appears as though by default celery will queue up the second job's 5 tasks | |
behind the first job's 100 and it will have to wait until the first job's | |
completion before it even begins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotebookResource(BackboneJSResource): | |
user = fields.ForeignKey(UserResource, 'user') | |
class Meta: | |
queryset = Notebook.objects.all() | |
authentication = MULTI_AUTH | |
authorization = OwnerAuthorization() | |
# allow to list posts for this notebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function khd | |
{ | |
[ -z $1 ] && echo "No line number given" && return -1 | |
sed -i -e "${1}d" ${HOME}/.ssh/known_hosts | |
} |
OlderNewer