Skip to content

Instantly share code, notes, and snippets.

View zookzook's full-sized avatar

Michael Maier zookzook

View GitHub Profile
@zookzook
zookzook / index.conf
Last active March 9, 2020 09:14
HOCON-Example
{
title: Using Phoenix Webframework as static content generator
pars: [
{
text: """
|## Introduction ##
|
|Phoenix is not only an excellent web framework, but also it can be transformed with a few steps into a
|static content generator. You need some programming knowledge, so this way is
|rather something for developers.
@zookzook
zookzook / Dockerfile
Created August 23, 2019 08:18
Dockerfile for deployment a phoenix application with elixir 1.9 and the new release feature
FROM elixir:1.9.1-alpine as build
# install build dependencies
RUN apk add --update build-base nodejs yarn
# prepare build dir
RUN mkdir /app
WORKDIR /app
# install hex + rebar
@zookzook
zookzook / ldif.ex
Created August 13, 2019 14:33
Parsing LDIF content file with NimbleParsec in Elixir
defmodule Ldif do
import NimbleParsec
name= ascii_string([?a..?z, ?A..?Z, ?0..?9], min: 1)
eol = ascii_char([?\n]) |> ignore()
assigment =
choice([
string("::") |> replace(:base64),
@zookzook
zookzook / update-container.sh
Last active October 27, 2018 08:05
How to stop containers with --restart=always
$ID = ??
docker stop $ID &
docker update --restart=no $ID &
@zookzook
zookzook / disable_watch_dog
Created January 25, 2013 14:03
Arduino sleep without watch dog. The most example for putting the Arduino into sleep mode use the watch dog. But if you have an external interrupt pin you don't really need the watch dog. The aim is to save power, therefore there is no need to get awake by the watch dog and then go to sleep again. The trick is to clear the MCUSR register before …
void setup() {
MCUSR = 0;
wdt_disable();
}