Skip to content

Instantly share code, notes, and snippets.


Camil Staps camilstaps

View GitHub Profile
camilstaps / fst.icl
Last active Mar 4, 2019
Arity-agnostic fst function in Clean
View fst.icl
module fst
fst :: a -> b // (a,b)->a, (a,b,c)->a, (a,b,c,d)->a, etc.
fst _ = code {
get_node_arity 0
push_b 0
push_b 0
.o 2 1 i
camilstaps / dyn.icl
Last active Feb 18, 2018
Monomorphic dynamics without language support
View dyn.icl
module dyn
import StdEnv
import Data.Maybe
:: Type
= Cons String
| App Type Type
instance == Type
camilstaps / lambda.tex
Created Sep 10, 2017
Lambda Calculus in TeX
View lambda.tex
\title{Lambda Calculus in \TeX}
\author{Camil Staps}
camilstaps / HTML_math_editor.user.js
Last active Jun 13, 2021
Stack Exchange HTML math editor
View HTML_math_editor.user.js
// ==UserScript==
// @name Stack Exchange HTML math editor
// @author Camil Staps <>
// @namespace nl.camilstaps.htmlmath
// @description Adds a math bar to the Stack Exchange editor
// @include /^https?:\/\/(.*\.)?stackoverflow\.com/.*$/
// @include /^https?:\/\/(.*\.)?serverfault\.com/.*$/
// @include /^https?:\/\/(.*\.)?superuser\.com/.*$/
// @include /^https?:\/\/(.*\.)?stackexchange\.com/.*$/
// @include /^https?:\/\/(.*\.)?askubuntu\.com/.*$/
camilstaps / IKS.icl
Last active Aug 3, 2016
IKS Interpreter
View IKS.icl
module IKS
import StdArray, StdFile, StdList, StdOverloaded, StdString
from StdFunc import o
import StdDynamic
import Data.Functor
import Control.Applicative
import Control.Monad
camilstaps / factorial.htaccess
Created Apr 18, 2016
Factorial in Apache rewrite rules
View factorial.htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^just/(1*)/?$ /index.php?just=$1 [L]
RewriteRule ^add-and/(\w+)/1(1*)/(1+)(/.*)$ /$1/$2$3$4
RewriteRule ^add/(1+)/(1+)/?$ /add-and/just/$1/$2/
camilstaps /
Last active Mar 31, 2022
How to write good pseudocode

How to write good Pseudocode

This is an unfinished list of remarks on how to write good pseudocode.

What is pseudocode?

Pseudocode is a loosely defined way of transmitting the concept of an algorithm from a writer to a reader. Central is the efficiency of this communication, not the interpretability of the code by an automated program (e.g., a parser).

camilstaps /
Last active Mar 2, 2016 — forked from pimeys/
Wireless plugin for xmobar
iwconfig "$INTF" 2>&1 | grep -q no\ wireless\ extensions\. && {
echo wired
exit 0
essid=`iwconfig "$INTF" | grep 'ESSID:' | cut -d' ' -f 2- | sed 's/^ *//g' | cut -d' ' -f 4- | sed 's/ *$//g'`
quality=`iwconfig "$INTF" | grep 'Link Quality' | sed 's/^ *//g' | cut -d'=' -f2 | cut -d' ' -f1`