-
Create a directory and
cd
into it -
Copy
index.html
andmain.js
into the directory -
Run this command to start a web server
python3 -m http.server 8080
This file contains hidden or 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
-- Semigroup | |
(<|^.^|>) :: Semigroup a => a -> a -> a | |
(<|^.^|>) = (<>) | |
infixr 6 <|^.^|> | |
-- Functor | |
(<|$.$|>) :: Functor f => (a -> b) -> f a -> f b | |
(<|$.$|>) = (<$>) |
This file contains hidden or 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
let | |
pkgs = import <nixpkgs> { }; | |
in | |
pkgs.writeShellScript "doi" '' | |
cat <<EOF | |
When in the Course of human events it becomes necessary for one people to | |
dissolve the political bands which have connected them with another and to | |
assume among the powers of the earth, the separate and equal station to which | |
the Laws of Nature and of Nature's God entitle them, a decent respect to the |
This file contains hidden or 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 nix-shell | |
#!nix-shell --packages youtube-dl ffmpeg moreutils -i bash | |
# shellcheck shell=bash | |
set -euo pipefail | |
main() { | |
if [ ! -d ~/.local/share/monty-python ]; then | |
echo "Creating directory '~/.local/share/monty-python'" >&2 |
This file contains hidden or 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
-- error: | |
-- Functional dependencies conflict between instance declarations: | |
-- instance Exception e => ToError e Error | |
-- instance Exception e => ToError (Either e a) (Either Error a) | |
data Error = Error | |
deriving stock Show | |
deriving anyclass Exception | |
class ToError i o | i -> o where |
This file contains hidden or 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
use std::{ | |
any::{Any, TypeId}, | |
collections::HashMap, | |
}; | |
#[derive(Default)] | |
pub struct TypeMap { | |
hash_map: HashMap<TypeId, Box<dyn Any>>, | |
} |
This file contains hidden or 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
{-# LANGUAGE LambdaCase #-} | |
{-# OPTIONS_GHC -Wall #-} | |
{-# OPTIONS_GHC -Wcompat #-} | |
{-# OPTIONS_GHC -Werror=incomplete-record-updates #-} | |
{-# OPTIONS_GHC -Werror=incomplete-uni-patterns #-} | |
{-# OPTIONS_GHC -Werror=missing-fields #-} | |
{-# OPTIONS_GHC -Werror=partial-fields #-} | |
{-# OPTIONS_GHC -Widentities #-} | |
{-# OPTIONS_GHC -Wmissing-home-modules #-} |
This file contains hidden or 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
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module Cont where | |
import Control.Monad.Trans.Cont (Cont, runCont) | |
data Tree a |
This file contains hidden or 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
let | |
nixpkgs = builtins.fetchGit { | |
url = "https://github.com/NixOS/nixpkgs.git"; | |
rev = "6f643a1098b30b060e7f719f84c8a7f9677d1c36"; | |
}; | |
pkgs = import nixpkgs { }; | |
in | |
pkgs.mkShell { |
This file contains hidden or 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
const fib = n => n == 0 ? 0 : n == 1 ? 1 : fib(n - 2) + fib(n - 1); | |
const fibs = [...Array(10).keys()].map(fib); | |
console.log(fibs); |