Skip to content

Instantly share code, notes, and snippets.

View tuhlmann's full-sized avatar
😎
Having fun developing new stuff

Torsten Uhlmann tuhlmann

😎
Having fun developing new stuff
View GitHub Profile
const path = require("path")
const config = require("./config/website")
const here = (...p) => path.join(__dirname, ...p)
const pathPrefix = config.pathPrefix === "/" ? "" : config.pathPrefix
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})
@tuhlmann
tuhlmann / core.clj
Created October 4, 2015 18:35
Quick & Dirty conversion of exported Wordpress posts into markdown
(ns word-parsos.core
(:gen-class)
(:require [clojure.xml]
[clojure.zip :as zip]
[clojure.data.zip.xml :as zip-xml]
[clj-time.core :as t]
[clj-time.format :as f]
[cuerdas.core :as str]
[clojure.pprint :as pprint]
[clj-commons-exec :as exec])

Keybase proof

I hereby claim:

  • I am tuhlmann on github.
  • I am tuhlmann (https://keybase.io/tuhlmann) on keybase.
  • I have a public key whose fingerprint is 6BB0 B2B1 B082 51D6 0B5D D1E3 3AE5 C98C 3996 38E5

To claim this, I am signing this object:

@tuhlmann
tuhlmann / gist:d2b82572fb9e73cfde78
Created November 24, 2014 18:55
Extending Lift's Mailer
package code.lib
import javax.mail.BodyPart
import javax.mail.internet.{MimeMultipart, MimeBodyPart}
import net.liftweb.util.Mailer
object ExtendedMailer extends Mailer with ExtendedMailer
trait ExtendedMailer extends Mailer {
@tuhlmann
tuhlmann / gist:fcce99ecc21e5a686076
Created October 11, 2014 07:24
org.odftoolkit.simple.common.navigation.ImageSelection
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
object Menus extends MyBsMenu
trait MyBsMenu extends SnippetHelper {
/**
* Produces a menu UL from a group, for use with Bootstrap.
*/
def group = {
val menus: NodeSeq =
for {
package code
package snippet
import scala.xml.{NodeSeq, Text}
import net.liftweb.util._
import net.liftweb.common._
import java.util.Date
import code.lib._
import Helpers._
import net.liftweb._
@tuhlmann
tuhlmann / gist:7019727
Created October 17, 2013 05:57
Using Localization without a Session
/*
* Copyright 2006-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
trait DocumentForm[OwnerType <: MongoIdRecord[OwnerType] with ClientId[OwnerType]] extends ObjectIdRefListField[OwnerType, Document] {
self: ObjectIdRefListField[OwnerType, Document] =>
def uploadDoneCallback: JsCmd
override def toForm =
uniqueFieldId match {
case Full(id) => Full(elem(id))
case _ => Full(elem(nextFuncName))
@tuhlmann
tuhlmann / gist:5227734
Created March 23, 2013 13:27
An example that shows a rescheduling comet that calculates stuff in the background and then causes a reRender after its ready.
class SchedulingComet extends CometActor {
case class ContentReady(html: RenderOut)
case class Refresh()
val waitTime = 10 minutes
private var laContent = new LAFuture[ContentReady]
override def localSetup() {