Skip to content

Instantly share code, notes, and snippets.

@MichaelAz
MichaelAz / Vector.agda
Created April 17, 2014 23:29
Vectors in different dependently typed programming lanugages
-- Based on the built in Agda implementation
module Vec where
-- The unit. A null of sorts.
data One : Set where
unit : One
-- A tuple.
data _*_ (A B : Set) : Set where
pair : A -> B -> A * B
@MichaelAz
MichaelAz / Anarchist Education or How to prevent school from ruinning you.md
Last active December 19, 2015 06:29
My message to the young programmers out there. We've all been where you are - read this. It'll save you some grief.

Anarchist Education or How to prevent school from ruinning you

I decided to learn programming when I was 14. I learned a bit of programming at an afterschool course for kids and I felt I had a knack for it. I opened a computer, opened Google and dived in. I didn't look back since.

Let me tell you, it was hard. I searched through tutorials, did some excercises but mainly I didn't know what to do. I stumbled onto StackOverflow which consolidated my knowledge a bit.

@MichaelAz
MichaelAz / Bad
Last active December 14, 2015 02:59
Bad - a javascript MVC microframework in 10 lines of code. Bad is to javascript MVC frameworks as McDonalds, Cheap Booze and Honey Boo Boo are to regular folks - it's so horrendously bad that it's good. In a just world this would not exist, but we live in a world of rushed spagheti code where this abomination fits perfectly. Client side MVC? Def…
// models is an object that defines the names of models, the names of their properties and their values which might be plain
// values or functions or whatever. pollingms is basically the refresh rate on the model. Views are defined in Handlebars.
// EXAMPLE OF USAGE IN THE NEXT FILE
function bad (models, pollingms) {
$(function() {
var originalHtml = $("html").html();
window.setInterval(function() {