Instantly share code, notes, and snippets.

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'
/// 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
# Base directory is current by default
# 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).

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:


This gist will show the support of BiDirectional text in the terminal emulators and console programs.

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

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
#!/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
e asm.arch=avr
wx 480f
pi 1
EXPECT='add r20, r24