Skip to content

Instantly share code, notes, and snippets.

David Udelson dudelson

Block or report user

Report or block dudelson

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
dudelson /
Last active Jan 29, 2020
Slides for my presentation at CyberArk

Keybase proof

I hereby claim:

  • I am dudelson on github.
  • I am dudelson ( on keybase.
  • I have a public key ASCFukV2GZLN1gqrjyLuW37sEpa60iK_s-P95FRNz_fKkgo

To claim this, I am signing this object:

dudelson /
Created Nov 21, 2017
Illustration of functors in ocaml and comparison to functions
(* Basic demonstration of how to create and use functors,
* as well as how they parallel functions *)
(* Here are the two (equivalent) ways to define a function *)
let f x = x + 1
let g = fun x -> x + 1
(* The functor has the same two syntaxes as the function, except whereas a
* function takes one or more 'expressions' (each of which has a 'type') and
dudelson /
Created Jun 19, 2017
A minimal example of how to use ocaml-webmachine to build a REST API. This API returns HTTP error 406 ("Not Acceptable") for every valid request
(** Returns http error 406 for every valid request.
build with: `ocamlbuild -use-ocamlfind -pkgs cohttp.lwt,lwt,webmachine main.byte` *)
open Cohttp
open Cohttp_lwt_unix
open Lwt.Infix
module Wm = struct
include Webmachine.Make(Cohttp_lwt_unix_io)
module Rd = Webmachine.Rd
dudelson /
Created Jun 14, 2017
Hook to update awesomewm battery widget
#!/usr/bin/env bash
export XAUTHORITY=/home/david/.Xauthority
export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
/usr/bin/awesome-client "local beautiful = require('beautiful'); beautiful.update_battery_widget()"
dudelson / toggle_airplane_mode
Created Jun 14, 2017
Script to toggle airplane mode on my laptop
View toggle_airplane_mode
# toggles airplane mode
if [ ! -d /sys/class/leds/tuxedo::airplane ]; then
echo "ERROR: Cannot enable airplane mode without tuxedo-wmi kernel module."
echo "Please make sure the module is loaded and try again"
exit 1
View configure_dotfiles
#!/usr/bin/env python
This script is run after user login. It parses my dotfile config
(~/.config/dotfiles.yml), and sets environment variables which my other
dotfiles can read in order to be informed of the options I want set.
This script only works with python 3.
import os, subprocess
dudelson / dotfiles.yaml
Created Jan 11, 2017
My dotfile configuration (system meta-configuration?) for my laptop
View dotfiles.yaml
monitors: [eDP1]
monitor_resolution_x: 1920
monitor_resolution_y: 1080
terminal: [1, 1]
browser: [1, 2]
emacs: [1, 3]
telegram: [1, 8]
dudelson /
Created Jan 9, 2017
The git pre-commit hook for my website. Responsible for building my blog archives and updating the "Last updated" info in the footer.
# this line is necessary to get the script to run in magit
echo "Running jekyll pre-build..." \
&& bundle exec jekyll build \
&& echo "Generating archives..." \
&& ruby blog/archive/_generator.rb \
&& git add blog/archive/dates blog/archive/tags \
dudelson / uva_10920_passing.cpp
Created Jan 8, 2017
My (passing) solution to UVA 10920
View uva_10920_passing.cpp
#include <iostream>
using namespace std;
typedef long long ll;
ll size, p, x, y;
int main() {
You can’t perform that action at this time.