Skip to content

Instantly share code, notes, and snippets.

View fnchooft's full-sized avatar

Fabian N.C. van 't Hooft fnchooft

View GitHub Profile
@fnchooft
fnchooft / sid_tools.erl
Created March 2, 2020 13:01
Sid encoding....
-module(sid_tools).
-compile([export_all]).
% https://github.com/core-wg/comi/blob/master/draft-ietf-core-comi.md
% https://tools.ietf.org/html/rfc4648#section-5
-define(CHARSET64,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_").
sid_encoded(Sid) ->
Chars = [
(Sid bsr 60) band 16#3F,
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1997-2020. All Rights Reserved.
%%
%% 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
@fnchooft
fnchooft / ErlangCode_to_XML
Last active November 9, 2021 22:55
From Erlang Code - via edoc - to a XML-representation
In order to use the Erlang-syntax as interface descriptions ( using types, records, fields , etc),
I needed an XML-representation for the module.
You might have heard for the AbstractCode which can be generated from the module, for instance like this:
```
{ok, {rec, [{abstract_code, Abs}]}} = beam_lib:chunks("rec.beam", [abstract_code])2> rp(Abs).
```
But that is not exactly what I wanted. While talking during CodeBeam about this the OTP team told me that edoc
already does this for you, and right they are:
@fnchooft
fnchooft / xlsx_file.livemd
Created April 23, 2024 01:33
Livebook Example for XLSX - Some data transformations are needed

XSLX - files new action

Mix.install([
  {:kino, "~> 0.12.0"},
  {:xlsx_reader, "~> 0.8.3"}
])

Section

@fnchooft
fnchooft / README
Created August 15, 2024 17:32 — forked from nkabardin/README
Erlang xmerl-based simple xml parsing
# Example xml
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<application id="test">
<platform id="vk">
<appId>123</appId>
<secretKey>secret</secretKey>
<packages>
<package id="vk0" price="100" points="3" />