Skip to content

Instantly share code, notes, and snippets.

View lbehnke's full-sized avatar

Lars Behnke lbehnke

  • Bruker Daltonik GmbH
  • Bremen
View GitHub Profile
@lbehnke
lbehnke / CleanArchitecture.md
Created August 22, 2025 07:58 — forked from ygrenzinger/CleanArchitecture.md
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@lbehnke
lbehnke / 2019-https-localhost.md
Created October 6, 2023 06:11 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@lbehnke
lbehnke / DendrogramFormatter.java
Created February 5, 2018 12:29
Newick formatter
public interface DendrogramFormatter {
String format(DendrogramNode root);
}
@lbehnke
lbehnke / ReportController
Last active January 18, 2018 16:01
Jasper Reports
package com.company.web.site;
import com.google.common.collect.Lists;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.design.JasperDesign;
@lbehnke
lbehnke / LdapApp.java
Created May 18, 2016 05:39
Read from Microsoft ActiveDirectory
class LdapApp
{
static DirContext ldapContext;
public static void main (String[] args) throws NamingException
{
try
{
Hashtable<String, String> ldapEnv = new Hashtable<String, String>(11);
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.PROVIDER_URL, "ldap://localhost:389");
@lbehnke
lbehnke / MySKScene.swift
Last active August 29, 2015 14:10
Display SpriteKit view. In your storyboard, set the view's custom class to SKView.
import SpriteKit
class MySKScene: SKScene {
// implementation
}
@lbehnke
lbehnke / loops.swift
Last active August 29, 2015 14:10
Common control structures: Loops
for index in 0...4 {}
for name in names {}
for (key, value) in map {}
for var i = 0; i < 10; i++ {}
for i in 0..<n {}
for c in "string" {}
while i < n {}
do {} while i < n
@lbehnke
lbehnke / DateUtils.swift
Last active August 29, 2015 14:10
Format time passed as unix time stamp
var secondsSince1970 = NSDate.date().timeIntervalSince1970
var dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "HH:mm"
let thisDate = NSDate(timeIntervalSince1970: secondsSince1970);
println("Time : " + dateFormatter.stringFromDate(thisDate))
@lbehnke
lbehnke / Service.swift
Created December 4, 2014 22:39
Use double in string
var temperature:Double = 35.0
self.label.text = "\(temperature)°"
@lbehnke
lbehnke / JsonParser.swift
Last active August 29, 2015 14:10
Parse JSON document returned from web service.
let temperature = (jsonResult["list"]? as NSArray)[0]["main"] as NSDictionary)["temp"] as? Double
let celsius = round(tempResult - 273.15)
if let city = (jsonResult["city"]? as? NSDictionary) {
if let country = (city["country"] as? String) {
println("Country :" + country );
}
}