Skip to content

Instantly share code, notes, and snippets.

View iwilare's full-sized avatar
🌌

Andrea Laretto iwilare

🌌
View GitHub Profile
@kahole
kahole / index.html
Last active April 26, 2024 06:04
*scratch*.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;
@cpressey
cpressey / dollar.scm
Created August 27, 2019 11:04
How Haskell's infix $ operator might look in Scheme
(define reduce
(lambda (subject complete-rules rules generation-id)
(if (null? rules)
subject
(let* ((rule-pair (car rules))
(rest-of-rules (cdr rules))
(pattern (car rule-pair))
(replacements (cdr rule-pair))
(new-gen-id (+ generation-id 1))
(new-subject (apply-rule subject pattern replacements generation-id)))
@rntz
rntz / MinimalNBE.hs
Last active May 13, 2024 09:17
Normalisation by evaluation for the simply-typed lambda calculus, in Agda
-- A simply-typed lambda calculus, and a definition of normalisation by
-- evaluation for it.
--
-- The NBE implementation is based on a presentation by Sam Lindley from 2016:
-- http://homepages.inf.ed.ac.uk/slindley/nbe/nbe-cambridge2016.pdf
--
-- Adapted to handle terms with explicitly typed contexts (Sam's slides only
-- consider open terms with the environments left implicit/untyped). This was a
-- pain in the ass to figure out.
open import Level
-- "Wok" stands for "weak omega kategory".
mutual
record Wok {i} (Obj : Set i) : Set (suc i) where
coinductive
constructor Wok:
infix 1 Hom
infixr 9 compo
field Arr : (a b : Obj) -> Set i
field Hom : (a b : Obj) -> Wok (Arr a b)
@xem
xem / codegolf.md
Last active June 8, 2024 22:28
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@huonw
huonw / blackmagic.rs
Created January 15, 2014 12:42
do-while loops in Rust
while {
let x = foo();
bar(x);
x != 0
} {}