Skip to content

Instantly share code, notes, and snippets.

View aikomastboom's full-sized avatar

Aiko Mastboom aikomastboom

View GitHub Profile
@aikomastboom
aikomastboom / json_map_builder.ex
Last active October 16, 2021 19:49 — forked from rcdilorenzo/json_map_builder.ex
Convert a elixir json-decoded object to a map no matter how deep
defmodule JSONMapBuilder do
def to_map(list) when is_list(list) and length(list) > 0 do
case list
|> List.first do
{_, _} ->
Enum.reduce(
list,
%{},
fn (tuple, acc) ->
{key, value} = tuple_to_key_value(tuple)
#!/usr/bin/env bash
#ramfs_size_mb=512
ramfs_size_mb=1536
origin=${HOME}/Development/ipe
name="iperam"
mount_point=${HOME}/Development/${name}
mkramdisk() {
ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512))
#ramdisk_dev=`hdid -nomount ram://${ramfs_size_sectors}`
#!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = """
---
author: Aiko Mastboom
module: pm2.py
short_description: nodeJS pm2 wrapper
description:
- This module helps managing processes using pm2 on hosts