Skip to content

Instantly share code, notes, and snippets.


Santiago Saavedra ssaavedra

View GitHub Profile
ssaavedra / operator.hs
Created Nov 7, 2016
Haskell and higher-order polymorphism. Intuitionstic logic and type theory.
View operator.hs
{-# LANGUAGE RankNTypes #-}
module Operator
(***) f g (x1, x2) = (f x1, g x2)
f :: [a] -> [a]
f = snd . splitAt 1
type GType a = ([a], [a])
ssaavedra / roswell.spec
Last active Sep 8, 2016
roswell specfile
View roswell.spec
Name: roswell
Summary: A lisp installer and launcher for major environments that just work
Release: 1%{?dist}
License: MIT
Group: Development/Tools
BuildRequires: libcurl-devel
ssaavedra / 5_cpu_percent
Created Sep 5, 2016
Get the CPU usage as a percentage. Great for use inside byobu/tmux, but can be used standalone.
View 5_cpu_percent
# 5_cpu_percent: get the global CPU usage as a percentage
# Copyright (C) 2016 Santiago Saavedra
# Authors: Santiago Saavedra <>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#!/usr/bin/env python3
# -*- coding: utf-8; -*-
# Author: Santiago Saavedra <>
# License: MIT
# Description:
# This script detects raspberries and sorts them by last-seen time.
# It also tries to inspect whether they still have their default
# password set.
# We found it specially interesting in IoT Hackathons and the like
# for participants to easily spot theirs (and actively remember
ssaavedra / 57-add-emoji-support.conf
Created Jun 19, 2016
Add Emoji to Linux Fontconfig
View 57-add-emoji-support.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
EmojiOne Color SVGinOT Font
Author: Santiago Saavedra <>
License: CC0
Year: 2016
View minexample-correct.lisp
(defpackage :mypackage
(:export :let))
(defpackage :mypackage.impl
(:use :cl))
(in-package :mypackage.impl)
(defmacro mypackage:let (a)
ssaavedra / tco.lisp
Created Mar 30, 2016
Improve TCO handling on Common Lisp easy cases
View tco.lisp
(defpackage :ssaavedra.tco
"Implements some silly optimizations for improved Tail Call
Optimization (TCO) so that when defining a function or a lambda ending
in a `case' or an `if' the enclosing frame can be removed.")
(:use :common-lisp)
(:export :tco-body :case-tco :defun-tco))
(in-package :ssaavedra.tco)
(defun tco-test ()
View .gitignore
# Author: Santiago Saavedra <>
# License: MIT
# Usage:
# 1. Set up Vagrant and VirtualBox
# 2. Download this file:
# curl >
# (or)
# wget
ssaavedra / org-clock-back.el
Last active Oct 1, 2018
Convert orgmode clocktable time to numbers
View org-clock-back.el
;; Receive time as a string like "9d 11:28"
;; Outputs the number of minutes in that
;; The regex works with and without days.
;; MIT License
(defun my-minutes-in-org-time (time)
(let ((re "\\(\\([0-9]+\\)d \\)?\\([0-9]+\\):\\([0-9]+\\)")
(values '(2 3 4)))
(catch 'exit
(if (not (string-match re time))