Skip to content

Instantly share code, notes, and snippets.

Fighting with OCaml

Anton Kochkov XVilka

Fighting with OCaml
View GitHub Profile
XVilka / Makefile
Last active Jul 5, 2021
Rizin API use with Go/cgo
View Makefile
go build -v
go run rz-api.go
# We use unicode quotes on purpose
# shellcheck disable=SC1112
XVilka /
Last active Sep 25, 2020
Simple Python script to search the files by pattern in the active GCC include paths.
#!/usr/bin/env python3
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
"""GCC Includes Search Script
This script allows to search the files among all paths that GCC currently set in the includes.
It is helpful for debugging problems with the old files and finding conflicts between multiple headers
of different versions of the same library.
XVilka /
Created Apr 9, 2020
Dotfiles Syncronization Script
#!/usr/bin/env python3
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=import-outside-toplevel
# pylint: disable=logging-format-interpolation
"""Dotfiles Syncronization Script
This script allows to syncronize your dotfiles among different computers with
XVilka /
Created Oct 26, 2019
Font shaping e.g. ligatures support in terminal emulators and applications

This gist will show the support of font shaping support in the terminal emulators and console programs.

Supporting font shaping

XVilka /
Created Jun 23, 2017 — forked from Sgeo/
Gadts in Rust
/// This type is only every inhabited when S is nominally equivalent to T
pub struct Is<S, T>(::std::marker::PhantomData<(*const S, *const T)>);
// Construct a proof of the fact that a type is nominally equivalent
// to itself.
pub fn is<T>() -> Is<T, T> { Is(::std::marker::PhantomData) }
// std::mem::transmute does not accept unsubstituted type parameters
// manual transmute as suggested by manual

Keybase proof

I hereby claim:

  • I am XVilka on github.
  • I am xvilka ( on keybase.
  • I have a public key whose fingerprint is BA9D 6CF9 322C 369D B202 9FCA E235 D217 9EDE 6823

To claim this, I am signing this object:

XVilka /
Last active May 22, 2021
BiDirectional Text

This gist will show the support of BiDirectional text in the terminal emulators and console programs. You can read more about the standardization efforts at the dedicated page of FreeDesktop Terminal BiDi working group.

How to test

Logical Order RTL LTR
WHAT IS UNICODE؟ in arabic in arabic ؟EDOCINU SI TAHW ؟EDOCINU SI TAHW in arabic
ما هو الترميز الموحد يونيكود؟ in Arabic ما هو الترميز الموحد يونيكود؟ in Arabic
XVilka /
Last active Aug 4, 2021
True Colour (16 million colours) support in various terminal applications and terminals

Most updated version is always available at termstandard/colors repository.

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
XVilka /
Created Dec 28, 2013
Unpacks *.BIO and *.CAP EFI capsule files
#!/bin/env python
import ctypes
import struct
import sys
import os
import array
EFI_CAPSULE_GUID = "BD86663B760D3040B70EB5519E2FC5A0".decode('hex') # 3B6686BD-0D76-4030-B70E-B5519E2FC5A0
EFI2_CAPSULE_GUID = "8BA63C4A2377FB48803D578CC1FEC44D".decode('hex') # 4A3CA68B-7723-48FB-803D-578CC1FEC44D
UEFI_CAPSULE_GUID = "B9829153B5AB9143B69AE3A943F72FCC".decode('hex') # 539182B9-ABB5-4391-B69A-E3A943F72FCC