Skip to content

Instantly share code, notes, and snippets.

💭
Fighting with OCaml

Anton Kochkov XVilka

Block or report user

Report or block XVilka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@XVilka
XVilka / Example.vim
Created Jul 31, 2018
Vim init extract
View Example.vim
" run ':so $MYVIMRC' on update, then ':PlugInstall'
call plug#begin('~/.vim/plugged')
"Plug 'Valloric/YouCompleteMe', { 'do' : function('BuildYCM')}
Plug 'MattesGroeger/vim-bookmarks'
Plug 'godlygeek/tabular'
"Plug 'bbchung/clighter8'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'edkolev/promptline.vim'
Plug 'vim-syntastic/syntastic'
@XVilka
XVilka / gadts.rs
Created Jun 23, 2017 — forked from Sgeo/gadts.rs
Gadts in Rust
View gadts.rs
/// This type is only every inhabited when S is nominally equivalent to T
#[derive(Debug)]
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
View radare-cygwin-build.sh
#!/bin/bash
# Base directory is current by default
BASE_DIR="."
# Use > 1 to consume two arguments per pass in the loop (e.g. each
# argument has a corresponding value to go with it).
# Use > 0 to consume one or more arguments per pass in the loop (e.g.
# some arguments don't have a corresponding value to go with it such
# as in the --default example).
View keybase.md

Keybase proof

I hereby claim:

  • I am XVilka on github.
  • I am xvilka (https://keybase.io/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
XVilka / BiDiSupport.md
Last active Apr 23, 2019
BiDirectional Text
View BiDiSupport.md

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
XVilka / TrueColour.md
Last active May 17, 2019
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

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
XVilka / bio_unpack.py
Created Dec 28, 2013
Unpacks *.BIO and *.CAP EFI capsule files
View bio_unpack.py
#!/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
View json tests
# -------------------------------
# ADD instruction
NAME="AVR: [ADD]"
FILE=malloc://32
CMDS='
e asm.arch=avr
wx 480f
pi 1
'
EXPECT='add r20, r24
You can’t perform that action at this time.