Skip to content

Instantly share code, notes, and snippets.

View dinosaure's full-sized avatar

Calascibetta Romain dinosaure

View GitHub Profile
@dinosaure
dinosaure / db.txt
Created January 25, 2021 12:08
Email database free
stone@meekness.com
ca-tech@dps.centrin.net.id
trinanda_lestyowati@telkomsel.co.id
asst_dos@astonrasuna.com
amartabali@dps.centrin.net.id
achatv@cbn.net.id
bali@tuguhotels.com
baliminimalist@yahoo.com
bliss@thebale.com
adhidharma@denpasar.wasantara.net.id
type bigstring =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
let length x = Bigarray.Array1.dim x [@@inline]
let to_int32 :
bigstring ->
(int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t =
fun ba ->
let len = length ba in
@dinosaure
dinosaure / main.ml
Created September 9, 2021 16:32
certificate in the flight
open Rresult
let prefix = X509.Distinguished_name.[Relative_distinguished_name.singleton (CN "PTT")]
let cacert_dn = X509.Distinguished_name.(prefix @ [Relative_distinguished_name.singleton (CN "Ephemeral CA for PTT") ])
let cacert_lifetime = Ptime.Span.v (365, 0L)
let cacert_serial_number = Z.zero
let run domain_name seed =
Domain_name.of_string domain_name >>= Domain_name.host >>= fun domain_name ->
let private_key =
let compress stdin stdout =
let jsonm = Jsonm.encoder `Manual in
let o = Bigstringaf.create De.io_buffer_size in
let i = Bytes.create De.io_buffer_size in
let t = Bigstringaf.create De.io_buffer_size in
let stop = ref false in
let rec encode gz = function
| `Partial ->
let len = Bytes.length i - Jsonm.Manual.dst_rem jsonm in
Bigstringaf.blit_from_bytes i ~src_off:0 t ~dst_off:0 ~len ;
@dinosaure
dinosaure / app.ml
Created April 19, 2021 14:15
`multipart_form` example
open Rresult
open Opium
open Lwt.Infix
let always x _ = x
let index =
let open Tyxml.Html in
html
(head (title (txt "Index")) [])
(* Une explication de [mimic] et de qu'il essaye de résoudre.
[mimic] est une toute petite librairie qui propose une ré-implementation
des méthodes virtuelles pour les modules. Dans un projet large tel que
Git ou Irmin, en gardant l'idée de l'abstraction du système requise pour
être compatible avec MirageOS, une question transcende tout les niveaux:
> comment abstraire le réseau ?
Dans le contexte spécifique Unix/<unistrd.h>, plusieurs fonctions existent
type 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val return : 'a -> 'a t
val both : 'a t -> 'b t -> ('a * 'b) t
end
module Make (IO : IO) = struct
let run =
print_endline "Hello World!" ;
(executable
(name main)
(libraries brr)
(modes js))
(rule (copy main.bc.js main.js))
(alias
(name app)
(deps main.js min.html))
open Lwt.Infix
let ( >>? ) x f =
x >>= function Ok x -> f x | Error err -> Lwt.return (Error err)
let getline queue =
let exists ~predicate queue =
let pos = ref 0 and res = ref (-1) in
Ke.Rke.iter
(fun chr ->

Conduit 3.0.0

I'm glad to announce the new release of [conduit][conduit]. Conduit is, technically, a framework which wants to provide an abstraction of protocols. It permits to implement free-dependencies protocols.

Introduction

The goal of Conduit is the abstraction of protocols. In OCaml, it exists several ways to abstract an implementation from something else. By this way, it