Skip to content

Instantly share code, notes, and snippets.

Camil Staps camilstaps

Block or report user

Report or block camilstaps

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
@camilstaps
camilstaps / top.tex
Last active Jan 18, 2019
Diagram explaining Task Oriented Programming
View top.tex
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\definecolor{ui}{HTML}{e64021}
\definecolor{tasks}{HTML}{7e63bc}
\definecolor{fp}{HTML}{076509}
\definecolor{sds}{HTML}{3d59ac}
\definecolor{types}{HTML}{f9bd1c}
\begin{document}
\begin{tikzpicture}[color=white]
@camilstaps
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
repl_args_b
decI
.o 2 1 i
@camilstaps
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
camilstaps / lambda.tex
Created Sep 10, 2017
Lambda Calculus in TeX
View lambda.tex
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{fancyvrb}
\fvset{tabsize=2}
\title{Lambda Calculus in \TeX}
\author{Camil Staps}
@camilstaps
camilstaps / tease.icl
Created Nov 29, 2016
Teasing the Clean compiler
View tease.icl
module tease
// Inspired by http://codegolf.stackexchange.com/a/71800/42682
(o) infixr 9
(o) f g x = f (g x)
f x = (x,x)
g = f o f
h = g o g
@camilstaps
camilstaps / HTML_math_editor.user.js
Last active May 3, 2019
Stack Exchange HTML math editor
View HTML_math_editor.user.js
// ==UserScript==
// @name Stack Exchange HTML math editor
// @author Camil Staps <info@camilstaps.nl>
// @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
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
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
camilstaps / WritingPseudocode.md
Last active May 8, 2019
How to write good pseudocode
View WritingPseudocode.md

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
camilstaps / wireless.sh
Last active Mar 2, 2016 — forked from pimeys/wireless.sh
Wireless plugin for xmobar
View wireless.sh
#!/bin/bash
INTF=$1
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'`
essid="${essid:7:(-1)}"
quality=`iwconfig "$INTF" | grep 'Link Quality' | sed 's/^ *//g' | cut -d'=' -f2 | cut -d' ' -f1`
You can’t perform that action at this time.