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
11:24:52:200 [Info] - LOG_PLUGIN: store_object_meta_data : mediafusion-integration-service:452051: Adding object:
title: MaxFm - a SHOUTcast.com member station
mime-type: audio/mpeg
url: http://yp.shoutcast.com/sbin/tunein-station.pls?id=29777
11:24:52:200 [Info] - LOG_PLUGIN: store_object_meta_data : mediafusion-integration-service:452051: Adding object:
title: 100% GENERATION DISCO FUNK )) GENERATION DISCO FUNK - Hot summer Soul, Disco, Funk Radio !!! - a SHOUTcast.com member station
mime-type: audio/mpeg
url: http://yp.shoutcast.com/sbin/tunein-station.pls?id=903206
11:24:52:200 [Info] - LOG_PLUGIN: store_object_meta_data : mediafusion-integration-service:452051: Adding object:
title: Loudcaster: Hittin Lick Radio - a SHOUTcast.com member station
@posativ
posativ / gist:1120050
Created August 2, 2011 11:52
diff in python using global alignment (needleman-wunsch)
def diff(si="-GGAAT", sj="-GGACAT"):
m = len(si);n = len(sj)
matrix = Matrix(m, n)
# init
matrix[0,0] = 0
for i in range(1, m):
matrix[i,0] = matrix[i-1, 0] + similarity(si[i], '-')
for j in range(1, n):
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] + '-'
@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 */
@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 / 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 / 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
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 / 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