Skip to content

Instantly share code, notes, and snippets.

View idkjs's full-sized avatar

Alain Armand idkjs

View GitHub Profile
@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:

Private Mailserver with Postfix, Dovecot and Fetchmail on macOS Big Sur M1

This is a simple installation and configuration manual to setup a private mailserver. The instructions will be continued in future...

Requirements

  • Apple M1 with macOS Big Sur but it should working at Intel Macs 64-bit too.
  • Replacement for the missing mail and imap services in the macOS Server
  • Receiving and sending emails of all accounts (private and business)
  • Using Postfix, Dovecot and Fetchmail
type t<'a> = Js.Promise.t<'a>
type error
@bs.new
external make: ((@bs.uncurry ~resolve: (. 'a) => unit, ~reject: (. exn) => unit) => unit) => t<'a> =
"Promise"
@bs.val @bs.scope("Promise") external resolve: 'a => t<'a> = "resolve"
@bs.val @bs.scope("Promise") external reject: exn => t<'a> = "reject"
@bs.val @bs.scope("Promise")
external all: array<t<'a>> => t<array<'a>> = "all"
@zero-tuesday
zero-tuesday / cgit-macos.md
Created September 29, 2020 23:31
Building cgit on macOS

Building cgit on macOS

Checkout and init the submodule.

git clone git://git.zx2c4.com/cgit
cd cgit
git submodule init
git submodule update
type heading =
| North
| South
| East
| West;
type position = {
x: int,
y: int,
heading,
type ordering =
| Greater
| Less
| Equal;
// ORD typeclass / interface module
module type ORD = {
type t;
let compare: (t, t) => ordering;
};
@danieldietrich
danieldietrich / module.ts
Last active June 22, 2021 17:54
How to define interoperable TypeScript modules (use Rollup.js to build cjs, mjs and umd modules)
namespace MyName {
export type MyType = string | number;
export const myValue: MyType = createSampleValue();
// internal
function createSampleValue(): string {
return "test";
}
open Relude.Globals; // I usually do this in bsconfig
type user = {
firstName: string,
lastName: string,
};
type error =
| AlreadyLoggedIn;
type context = {
@ryyppy
ryyppy / RichText.re
Last active June 16, 2021 20:05
deep-dive-reason-union-types
module Mark = {
[@unboxed]
type t =
| Any('a): t;
module Link = {
type attrs = {
href: string,
target: string,
};

git clone and cd function

A simple little alias function that lets you clone and cd into a GitHub repo in one command.

Installation

Add to your zsh or bash config (usually ~/.bash_profile or ~/.zshrc) and open a new terminal to be able to use the function.

Usage

gcd [github_repo_owner/repo_name]