Skip to content

Instantly share code, notes, and snippets.

View n2o's full-sized avatar
🕵️‍♂️
...

Christian Meter n2o

🕵️‍♂️
...
View GitHub Profile

Keybase proof

I hereby claim:

  • I am n2o on github.
  • I am n2o (https://keybase.io/n2o) on keybase.
  • I have a public key whose fingerprint is AC6C D93A 2193 BCEA E693 92D4 DC36 932E EAE5 4549

To claim this, I am signing this object:

@n2o
n2o / .vimrc
Created May 16, 2015 10:47
.vimrc
" ==========================================================
" Vundle
" ==========================================================
set encoding=utf8
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
@n2o
n2o / New_StartSSL_Certs.md
Created December 31, 2015 14:01
Apache SSL Configuration with new StartSSL certificates

StartSSL reworked their homepage and some other stuff, which is why it now seems that sub.class1.server.ca.pem is unsupported. They now provide new certificates, which must be included into the Apache configuration. The new certificate is called 1_root_bundle.crt and provides all you need to complete the Chain of the certificates to enable trusted and secure communication with your webserver.

Therefore, you have to use the new root_bundle.crt instead of the old sub.class1.server.ca.pem. These lines have to be changed in your Apache configuration:

 SSLEngine on

Simple Monads in Clojure

Original post from 19th February 2014.

Description

This project shows the usage of the two monads Sequence- and Maybe-Monad.

Here are two short examples:

  1. Make the Addition of 3 numbers nil-safe
@n2o
n2o / docker-ip.md
Last active February 23, 2024 16:37
Show IP of your docker-container

Show IP of your Docker container

tested on Arch Linux x64 4.5.4-1-ARCH

Ever needed the IP of your running docker container? I found a script somewhere on Stackoverflow, packed it into a function and created an alias for it. This function is just a shorthand to get the IP by container ID or by the container's name:

Append this to your .bash_aliases or similar:

# ~/.bash_aliases
@n2o
n2o / professional-programming-summer-2017-week-4.md
Last active May 18, 2017 08:53
Professional Programming: Results of practical exercises, week 4

Task: Read a CSV file and correctly parse it. Then calculate the sum of those students, who achieved 50 points or more in the exam.

The CSV file is located in resources/punkte.csv.

App.java

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import java.io.FileReader;
import java.io.Reader;
@n2o
n2o / datomic-basics.md
Last active May 26, 2017 13:52
Basic datomic scheme, some transactions and queries

There are only few tutorials showing a step-by-step guide for datomic. This Gist might give you some exemplary code to get started with this interesting type of database.


Require the datomic api from [com.datomic/datomic-pro "0.9.5561"]:

(require '[datomic.api :refer [q transact] :as d])
@n2o
n2o / professional-programming-summer-2017-week-6.md
Last active June 30, 2017 17:06
Professional Programming: Results of practical exercises, week 6

Results (so far) from our practical exercises: Solving the Mars Rover Kata

// build.gradle

apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'jacoco'

repositories {
@n2o
n2o / professional-programming-summer-2017-week-7.md
Created June 8, 2017 11:00
Professional Programming: Results of practical exercises, week 7

Today, we played around with Unirest, gson and a sample API to address our requests to. This is just a simple and small example, because we had not much time to live-code this problem.

import com.google.gson.Gson;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
@n2o
n2o / professional-programming-summer-2017-week-11.md
Last active June 29, 2017 11:41
Professional Programming: Results of practical exercises, week 11: JavaFX

This week we started with JavaFX and created a simple HelloWorld-Application. Later, we created a more advanced UI with the Gluon SceneBuilder. But I will only upload our hello-world example, since working with the SceneBuilder is straightforward.

This is a gradle project and the source code is based on the standard JavaFX template by IntelliJ.

// build.gradle