This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preliminary notes: | |
1. Where necessary the following function was used to convert parser output to | |
canonical form (to detect equivalent syntax trees up to associativity of | |
statement composition): | |
tx :: Stm -> Stm | |
tx (Comp (Comp a b) c) = tx (Comp a (Comp b c)) | |
tx (Comp a b) = (Comp (tx a) (tx b)) | |
tx (If b s1 s2) = (If b (tx s1) (tx s2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Proc where | |
import Prelude hiding (Num, and, lookup, map) | |
import Control.Applicative hiding (empty) | |
import Control.Arrow (second) | |
import Control.Monad | |
import Data.Functor.Identity (Identity) | |
import Data.Map.Lazy | |
import Data.Maybe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Color { | |
constructor (r, g, b) { | |
this.r = r | |
this.g = g | |
this.b = b | |
} | |
toHex () { | |
return [this.r, this.g, this.b].reduce( | |
(a, b) => a + ('00' + b.toString(16)).slice(-2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontFamily": "Maison Mono, Input Mono Light, Menlo, monospace", | |
"editor.fontSize": 13 /*13, 10, 11.4*/, | |
"editor.lineHeight": 15, /*12*/ | |
"editor.rulers": [80], | |
"editor.wordWrap": "off", | |
"editor.wrappingIndent": "indent", | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DATA | |
## USER | |
email KEY string | |
name string | |
elevated boolean | |
auth string -> USER.email | |
key string | |
expires date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
REDIS SCHEMA | |
------------ | |
SET @domain.al@email key | |
STRING @domain.ae@email token | |
HASH @domain.as@key A acl, S secret | |
HASH @domain.u@email N name, A acl, [T trustee], [X delete] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# required in process.env: host, cloudant_account, cloudant_key, cloudant_pass, | |
# cloudant_db_accounts, cloudant_db_data, cookie_secret, redis_url, redis_port, redis_path, | |
# smtp_email, smtp_pass, smtp_host, smtp_ssl | |
bodyParser = require 'body-parser' | |
cloudant = require 'cloudant' account: process.env.cloudant_account, | |
key: process.env.cloudant_key, | |
password: process.env.cloudant_pass | |
email = require 'email' | |
express = require 'express' () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt install curl wget git zip unzip -y | |
echo "Install all developer tools?" | |
select yn in "Yes" "No"; do | |
case $yn in | |
Yes ) sudo apt install -y build-essential cmake python-dev python3-dev golang-go nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
link(rel='stylesheet', href='style.css') | |
title Flyt | |
body | |
header | |
nav.row | |
.left-unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mastermind { | |
constructor() { | |
this.length = 4 | |
this.chars = ['0', '1', '2', '3', '4', '5'] | |
} | |
generate() { | |
this.guesses = 0 | |
this.key = [] | |
for (var i = 0; i < this.length; i++) |