Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View posativ's full-sized avatar

Martin Zimmermann posativ

  • bergfex GmbH
  • Graz
View GitHub Profile
@posativ
posativ / lookit-custom-cloudapp-provider.patch
Created May 28, 2014 09:11
implement configurable CloudApp API url #51
commit 55e9f2635f8c5beb794f87592679e74daf1c4b6d
Author: posativ <info@posativ.org>
Date: Fri Aug 31 22:26:12 2012 +0200
remove orderedDict since poster can also use lists
diff --git a/src/cloud.py b/src/cloud.py
index 27ff0ea..b9d57bd 100644
--- a/src/cloud.py
+++ b/src/cloud.py
  • Arrow: better dates and times for Python
  • ftfy: fixes text for you
  • colors.py: Colors aren't that scary!
@posativ
posativ / transmission.rb
Created November 25, 2012 20:16
transmission
require 'formula'
class Transmission < Formula
homepage 'http://www.transmissionbt.com/'
url 'http://download.transmissionbt.com/files/transmission-2.73.tar.bz2'
sha1 '49f886ecb391c8901cd40f42b2f4a0df1ea4dcab'
depends_on 'pkg-config' => :build # So it will find system libcurl
depends_on 'libevent'
depends_on 'intltool' => :optional
@posativ
posativ / gist:4067083
Created November 13, 2012 17:17
pelican versus acrylamid
~/dev/bench/pelican$ find content/ | wc -l
1029
~/dev/bench/pelican$ time make html
find /Users/ich/dev/bench/pelican/output -mindepth 1 -delete
pelican /Users/ich/dev/bench/pelican/content -o /Users/ich/dev/bench/pelican/output -s /Users/ich/dev/bench/pelican/pelicanconf.py
WARNING: Feeds generated without SITEURL set properly may not be valid
Done
real 0m25.691s
require 'formula'
class Libtorrent < Formula
homepage 'http://libtorrent.rakshasa.no/'
url 'http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz'
sha1 '4f34a744fbe10c54aaf53d34681fabc1a49d7257'
depends_on 'pkg-config' => :build
depends_on 'libsigc++'
@posativ
posativ / test_storage.patch
Created September 20, 2012 21:09
test_storage.patch
--- a/syncstorage/tests/functional/test_storage.py Mon Sep 03 12:52:24 2012 +1000
+++ b/syncstorage/tests/functional/test_storage.py Tue Sep 04 18:09:51 2012 +0200
@@ -583,7 +583,7 @@
self.assertEquals(res.json["payload"], _PLD)
# deleting all with no confirmation
- self.app.delete(self.root + '/storage', status=400)
+ self.app.delete(self.root + '/storage', status=412)
# deleting all for real now
@posativ
posativ / newsbeuter.diff
Created April 20, 2012 21:22
newsbeuter 2.5 on Lion
diff --git a/config.sh b/config.sh
index 7867fcd..716915c 100755
--- a/config.sh
+++ b/config.sh
@@ -100,6 +100,7 @@ check_pkg "libcurl" || check_custom "libcurl" "curl-config" || fail "libcurl"
check_pkg "libxml-2.0" || check_custom "libxml2" "xml2-config" || fail "libxml2"
check_pkg "stfl" || fail "stfl"
check_pkg "json" || fail "json"
-check_custom "ncursesw5" "ncursesw5-config" || fail "ncursesw5"
check_ssl_implementation
@posativ
posativ / search.js
Created January 7, 2012 16:04
acrylamid static site search
$(document).ready(function() {
oldhtml = null;
entries = null;
$('#page a img').not('.nowrap').wrap('<div class="divImg">');
$('#page img').not('#page a img').not('.nowrap').wrap('<div class="divImg"><a href="#" onclick="openImage(this); return false;">');
entries = null;
oldhtml = null;
function htmlEscape(str) {
return str.replace(/&/g,'&amp;').
@posativ
posativ / gist:1273071
Created October 8, 2011 23:46
trac coderay CSS
/************* CodeRay styles **pimped** *************/
.syntaxhl .hll { background-color: #ffffcc }
.syntaxhl .c { color: #999988; font-style: italic } /* Comment */
.syntaxhl .er { color: #a61717; background-color: #e3d2d2 } /* Error */
.syntaxhl .kw { font-weight: bold } /* Keyword */
.syntaxhl .o { font-weight: bold } /* Operator */
.syntaxhl .c { color: #999988; font-style: italic } /* Comment.Multiline */
.syntaxhl .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.syntaxhl .c1 { color: #999988; font-style: italic } /* Comment.Single */
.syntaxhl .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
def smithwaterman(str1='-TSASAKARA', str2='-TASASRAR'):
def trace(i,j, u):
if u == 0:
return ''
else:
if matrix[i-1][j-1] + similarity(str1[i], str2[j]) == u:
return trace(i-1,j-1, matrix[i-1][j-1]) + str1[i] + str2[j]
if matrix[i-1][j] + similarity(str1[i], '-') == u:
return trace(i-1, j, matrix[i-1][j]) + str1[i] + '-'