Skip to content

Instantly share code, notes, and snippets.

View ssaavedra's full-sized avatar

Santiago Saavedra ssaavedra

View GitHub Profile
@ssaavedra
ssaavedra / using-emacs-to-write-clir-files.md
Last active November 18, 2016 16:40
How to use Emacs to write CLIR files

This is a Beginners Guide to writing CAVI-ART's CLIR files using Emacs, for people who has never used Emacs.

Introduction to Emacs

Emacs is a editor very leaned to using the keyboard as the primary input method. Thus, most commands on Emacs can be entered through the keyboard, although most can also be entered through the toolbar with the mouse.

@ssaavedra
ssaavedra / operator.hs
Created November 7, 2016 13:30
Haskell and higher-order polymorphism. Intuitionstic logic and type theory.
{-# LANGUAGE RankNTypes #-}
module Operator
where
(***) f g (x1, x2) = (f x1, g x2)
f :: [a] -> [a]
f = snd . splitAt 1
type GType a = ([a], [a])
@ssaavedra
ssaavedra / roswell.spec
Last active September 8, 2016 16:55
roswell specfile
Name: roswell
Version: 0.0.6.65
Summary: A lisp installer and launcher for major environments that just work
Release: 1%{?dist}
License: MIT
URL: https://github.com/roswell/roswell/
Source0: https://github.com/roswell/roswell/archive/v%{version}.tar.gz
Group: Development/Tools
BuildRequires: libcurl-devel
@ssaavedra
ssaavedra / 5_cpu_percent
Created September 5, 2016 16:32
Get the CPU usage as a percentage. Great for use inside byobu/tmux, but can be used standalone.
#!/bin/bash
#
# 5_cpu_percent: get the global CPU usage as a percentage
#
# Copyright (C) 2016 Santiago Saavedra
#
# Authors: Santiago Saavedra <santiagosaavedra@gmail.com>
#
# 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 <ssaavedra@gpul.org>
# 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
ssaavedra / 57-add-emoji-support.conf
Created June 19, 2016 10:36
Add Emoji to Linux Fontconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
EmojiOne Color SVGinOT Font
Author: Santiago Saavedra <ssaavedra@gpul.org>
License: CC0
Year: 2016
Install:
(defpackage :mypackage
(:use)
(:export :let))
(defpackage :mypackage.impl
(:use :cl))
(in-package :mypackage.impl)
(defmacro mypackage:let (a)
@ssaavedra
ssaavedra / tco.lisp
Created March 30, 2016 13:46
Improve TCO handling on Common Lisp easy cases
(defpackage :ssaavedra.tco
(:documentation
"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 ()
@ssaavedra
ssaavedra / .gitignore
Last active April 7, 2016 15:36
CLIR Attempt
*~
*.swp
*.fasl
*.FASL
*.lisp-temp
#!/bin/sh
# Author: Santiago Saavedra <s.saavedra@fdi.ucm.es>
# License: MIT
#
# Usage:
# 1. Set up Vagrant and VirtualBox
# 2. Download this file:
# curl https://gist.githubusercontent.com/ssaavedra/1ffa0a6f4b51cee04703/raw/run-why3.sh > run-why3.sh
# (or)
# wget https://gist.githubusercontent.com/ssaavedra/1ffa0a6f4b51cee04703/raw/run-why3.sh