Skip to content

Instantly share code, notes, and snippets.

@Et7f3
Et7f3 / print_sorted.ml
Last active December 25, 2018 01:28
print a liste sorted
let print_sorted =
let rec filter acc f = function
[] -> []
| e :: l when e = f -> List.rev acc @ l
| e :: l -> filter (e :: acc) f l
in let rec minimum m = function
[] -> m
| e :: l -> minimum (min e m) l
in let rec p = function
[] -> ()
@Et7f3
Et7f3 / display_float_double.c
Created February 22, 2019 00:06
tool provided to display the binary representation of float and double in C
#include <stdio.h>
#include <string.h>
void print_float_header()
{
printf("%d\n%-10s|%-s|%-8s|%-23s|\n", sizeof(float), "float", "S", "E", "M");
}
void print_float(float f)
{
char data[sizeof(f)];
@Et7f3
Et7f3 / ascii.ml
Created April 15, 2019 14:29
Man ascii generator for windows
(**
compiled with
ocamlopt ascii.ml -o ascii
or
ocamlopt.opt.exe ./ascii.ml -o ./ascii.exe
*)
let () =
Printf.printf "oct | dec | hex | char%10soct | dec | hex | char\n" " "
@Et7f3
Et7f3 / revery_my_app.ml
Created April 22, 2019 17:12
test for React.Hook
open Revery
open Revery.UI
open Revery.UI.Components
type main_view_state =
{
input: string;
}
module MainView = struct
@Et7f3
Et7f3 / MiMo Speeder
Created May 6, 2019 10:04
Un petit accélérateur de vidéo
// ==UserScript==
// @name MiMo Speeder
// @namespace http://tampermonkey.net/
// @version 0.1
// @description speed-up the MiMo videos
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
@Et7f3
Et7f3 / main.cs.disass
Created May 8, 2019 18:34
main.c disassembled to shwo reaonly
.class private auto ansi beforefieldinit Program
extends [mscorlib]System.Object
{
.field public initonly string VarC
.field public static literal string VarD = "e"
// method line 1
.method public hidebysig specialname rtspecialname
instance default void '.ctor' () cil managed
{
@Et7f3
Et7f3 / ligature.html
Created May 9, 2019 01:49
trying fira_code
<!DOCTYPE html>
<html>
<body>
<style>
/* CSS */
@import url(https://cdn.jsdelivr.net/gh/tonsky/[email protected]/distr/fira_code.css);
div {
/* Specify in CSS */
@Et7f3
Et7f3 / minesweeper.re
Created May 18, 2019 21:10
minesweeper with revery
open Revery;
open Revery.UI;
let () = Random.self_init()
module Row = {
let component = React.component("Row");
let createElement = (~children, ()) =>
component(hooks => {
@Et7f3
Et7f3 / main.bs.js
Last active August 25, 2019 10:51
Try compare ReactDOMRe.createElement vs ReactDOMRe.createElementVariadic
// Generated by BUCKLESCRIPT VERSION 5.0.4, PLEASE EDIT WITH CARE
'use strict';
var Block = require("./stdlib/block.js");
var Curry = require("./stdlib/curry.js");
var React = require("react");
var ReactDOMRe = require("./stdlib/reactDOMRe.js");
var a = React.createElement("div", undefined, "e");
@Et7f3
Et7f3 / dune
Created August 27, 2019 15:22
OCaml-websocket+opium
(executable
(name host_web)
(libraries opium websocket-lwt-unix.cohttp))