Skip to content

Instantly share code, notes, and snippets.

🐪
Edit status

Vladimir Keleshev keleshev

🐪
Edit status
Block or report user

Report or block keleshev

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
View Makefile
.PHONY: always_run
%.exe: %.s always_run
@arm-linux-gnueabihf-gcc -static -o $@ $<
@-qemu-arm-static $@; echo $$?
@rm -f $@
@keleshev
keleshev / ctrl.reg
Created Oct 22, 2019
Windows Registry script for mapping Caps Lock to Ctrl
View ctrl.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
View length.ml
let rec compare_lengths l1 l2 =
match l1, l2 with
| [], [] -> 0
| [], _ -> -1
| _, [] -> 1
| _ :: l1, _ :: l2 -> compare_lengths l1 l2
let rec compare_length_with l n =
match l with
View base_vs_stdlib.md

Comparision of JaneStreet Base and OCaml Stdlib

How to use Base

Either use Base selectively:

# #show List.hd;;
View environment_monad.ml
module Environment = struct
type t = (string * int) list
let set id number env = (id, number) :: env
let rec get id = function
| [] -> 0
| (key, value) :: tail ->
View precedence_1.ml
open Printf
module Token = struct
type t =
| Number of int
| Addition
| Exponent
| Left_paren
| Right_paren
end
View free.ml
let (=>) left right = print_char (if left = right then '.' else 'F')
module Env = struct
include Set.Make (String)
let to_list t = fold List.cons t []
end
View trmc.ml
let rec map f = function
| [] -> []
| x :: xs -> f x :: map f xs
View undo.ml
let hd list = List.nth_opt list 0
let (>>) f g x = g (f x)
let unoption = function
| None -> assert false
| Some a -> a
module Zipper = struct
View deriving-tagless-final.ml
open Printf
module type GENERIC = sig
type t
val constructor : string -> int -> t list -> t
val string : string -> t
val int : int -> t
end
You can’t perform that action at this time.