Skip to content

Instantly share code, notes, and snippets.

@meirbon
meirbon / Dell XPS 15 9560 Manjaro Setup instructions
Last active May 13, 2024 02:39
Small, quick guide to set up Manjaro on the XPS 15 9560
# 1. First of all of course get Manjaro:
https://manjaro.org/get-manjaro/
# I recommend using Etcher to copy the image to your USB:
https://etcher.io/
# 2. Before installing make sure:
# - Secure boot is disabled in BIOS
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much
@atavener
atavener / monad.ml
Last active September 22, 2018 14:43
A few monads to ultimately provide a Resource monad. This was created to work with Tsdl (tiny SDL bindings) which uses a result type (matching the Result monad here). I've found the Resource monad to be useful for a chain of dependent initializations (each step must succeed to continue), with the return value being the pair of a final result, an…
(*
A few monads... the incentive was to have an easy way to work with Tsdl.
The "Result" monad corresponds to the result type returned by most Tsdl calls.
"Release" accumulates a chain of "clean-up" functions.
Together they form "Resource" which handles Ok/Error results and accumulates
clean-up functions which are returned.
@yomimono
yomimono / ec2-ebs-ami.sh
Last active June 21, 2016 12:21
Automate creation of an EC2-ready Mirage unikernel.
#!/bin/bash
#set -e
#set -x
fail() {
echo $1
[ -e ${EBS_DEVICE} ] && [ "$VOLUME_ID" != "" ] && [ $REGION != "" ] && {
ec2-detach-volume --region $REGION $VOLUME_ID
ec2-delete-volume --region $REGION $VOLUME_ID
@hcarty
hcarty / lwt_zmq.ml
Created April 1, 2012 23:56
Attempt at Lwt-enabled zeromq
module Lwt_socket = struct
type 'a t = {
socket : 'a ZMQ.Socket.t;
fd : Lwt_unix.file_descr;
}
let of_socket socket = {
socket;
fd = Lwt_unix.of_unix_file_descr ~blocking:false (ZMQ.Socket.get_fd socket);
}
@hcarty
hcarty / log.ml
Created March 13, 2012 20:05
Simple OCaml logging, conceptually modeled after Log::Log4perl's easy mode
open Batteries
module type Level_sig = sig
type t
val to_string : t -> string
val default_level : t
val compare : t -> t -> int
end
module type S = sig
@zbroyar
zbroyar / gist:1432555
Created December 5, 2011 06:28
OCaml CURL GET, POST, PUT, DELETE examples
(* ocamlfind ocamlopt -o exmpl -package curl -linkpkg exmpl.ml *)
open Printf
let _ = Curl.global_init Curl.CURLINIT_GLOBALALL
(*
*************************************************************************
** Aux. functions
*************************************************************************
*)