Skip to content

Instantly share code, notes, and snippets.

View idkjs's full-sized avatar

Alain Armand idkjs

View GitHub Profile
type contact = {
id: int64,
email: string,
};
module Contacts = Map.Make(Int64);
type email = {
from_addr: string,
to_addr: string,
title: string,
body: string,
@idkjs
idkjs / Dune.md
Created May 13, 2021 16:42 — forked from jtpaasch/Dune.md
Notes on using `dune` for OCaml.

Dune

A first pass

A library and then an executable that uses that library.

A simple library

Create a folder called foo:

@idkjs
idkjs / drevo-caliber.json
Created March 31, 2021 17:18 — forked from weblogix/drevo-caliber.json
[Karabiner-Elements] for DREVO Calibur 71-key Keyboard #mac #keyboard #karabiner
{
"title": "DREVO Calibur 71-key Keyboard",
"rules": [
{
"description": "Set ESC to grave_accent_and_tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@idkjs
idkjs / xcode_info.zsh
Last active March 17, 2021 11:15
script to get xcode information on my machine. uses .zsh to get the coloring.
#!/bin/zsh
bold="\e[0;91m"
blue="\e[0;94m"
expand_bg="\e[K"
bold="\e[0;104m${expand_bg}"
bold_bg="\e[0;101m${expand_bg}"
green_bg="\e[0;102m${expand_bg}"
green="\e[0;92m"
white="\e[0;97m"
@idkjs
idkjs / migrate.sh
Created March 16, 2021 12:01
migrate files between .re .rei .res .resi .ml .mli syntax for ocaml, reasonml, bucklescript, rescript syntaxes
#!/bin/sh
# deleting converted files
Delete(){
RE() {
filenames=$(find "$(pwd)" -name "*.re")
len=${#filenames[@]}
echo "$len"
echo "$filenames"
for filename in $filenames; do rm "$filename"; done;
@idkjs
idkjs / SymbolIterator.re
Last active February 28, 2021 20:23
UnboxedAnyVariantConstructor
/** Compatible with OCaml standard library */
/** https://discord.com/channels/235176658175262720/235199119747055616/705145905971462275 */
module type Iter = {
type t('a);
let iter: ('a => unit, t('a)) => unit;
};
module JsIterable = {
type t('a);
type iterator('a);
@idkjs
idkjs / aria2c.md
Created February 12, 2021 11:49 — forked from danylokos/aria2c.md
aria2c multithread download
aria2c \
-x 16 \
-s 16 \
--load-cookies=cookies.txt \
https://download.developer.apple.com/Developer_Tools/Xcode_10.3/Xcode_10.3.xip
@idkjs
idkjs / delete-postmaster.id.sh
Created January 29, 2021 13:13
stale postmaster.id
cd $HOME/Library/Application Support/Postgres/var-13
rm postmaster.id
# or
rm $HOME/Library/Application Support/Postgres/var-13/postmaster.id
cat "$HOME/Library/Application Support/Postgres/var-13/postmaster.pid"
582
/Users/user/Library/Application Support/Postgres/var-13
@idkjs
idkjs / how-to-delete-all-commit-history-in-github.sh
Created January 17, 2021 16:05
how-to-delete-all-commit-history-in-github
# https://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github#26000395
# echo Checkout
git checkout --orphan latest_branch
# echo Add all the files
git add -A
@idkjs
idkjs / homebrew-permissions-issue.md
Created December 16, 2020 11:05 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*