Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am soeren on github.
  • I am soeren (https://keybase.io/soeren) on keybase.
  • I have a public key whose fingerprint is 9EC7 3EC9 3472 8249 A787 F4E5 0D1A 36BB 0BE2 7792

To claim this, I am signing this object:

View jython_call.java
ScriptEngine engine = new ScriptEngineManager().getEngineByName("python");
engine.eval(new FileReader("foobar.py"));
Bindings bind = engine.getBindings(ScriptContext.ENGINE_SCOPE);
PyFunction func = (PyFunction) bind.get("func");
Foo foo = new Foo();
PyObject ret = func.__call__(Py.java2py(foo));
Bar bar = Py.tojava(ret, Bar.class);
View blog_mode.el
(define-derived-mode blog-mode text-mode "Blog"
"A major mode for editing blog posts.")
(add-to-list 'auto-mode-alist '("/home/soeren/scm/blog/[^/]*\\.txt\\'" . blog-mode))
(add-hook 'blog-mode-hook 'longlines-mode)
View gist.py
import httplib
import urllib
import re
import os.path
def gist_write(name, content, ext=None, login=None, token=None):
if ext is None:
ext = os.path.splitext(name)[1]
View Hgmc.hs
-- Haskell GMail Count
-- soeren openfoo.org
import System.Directory
import System.FilePath
import Network.Curl
import qualified Text.Feed.Import as F
import qualified Text.Feed.Types as T
import qualified Text.XML.Light as X