This has moved to https://github.com/jaspervdj/zurical
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
{ }: | |
let | |
pkgs = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/17.03.tar.gz) { }; | |
exactOverride = self: pkg: version: pkgs.haskell.lib.dontCheck (self.callCabal2nix | |
pkg | |
(builtins.fetchTarball { | |
url = "https://hackage.haskell.org/package/${pkg}-${version}/${pkg}-${version}.tar.gz"; | |
}) | |
{ } |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
module Subscribe where | |
import qualified Data.IORef as IORef | |
import Data.Proxy (Proxy (..)) | |
import qualified Data.Map as Map | |
-- Event types, just stupid examples | |
data Event |
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 python | |
import os.path | |
import sys | |
import time | |
import urllib.parse | |
import urllib.request | |
from typing import Iterable | |
def get_segment_urls(m3u8_url: str) -> Iterable[str]: | |
m3u8_text: str = urllib.request.urlopen(m3u8_url).read().decode('utf-8') |
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
-- Imagine you're trying to guess someone's PIN code, and you have limited | |
-- info on each digit, e.g. if the digit is odd or even. | |
type Predicate a = a -> Bool | |
-- This is the info we have about the PIN code. | |
info :: [Predicate Int] | |
info = [odd, even, even, odd] | |
-- A helper to produce all digits satisfying a predicate. | |
digits :: Predicate Int -> [Int] |
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
#!/bin/bash | |
set -o nounset -o errexit -o pipefail | |
# Create temporary locations for the configuration and data directories. | |
CONFIG="$(mktemp)" | |
DATADIR="$(mktemp -d)" | |
# Write the configuration to the temporary location. | |
echo "media_dir=$PWD" >>"$CONFIG" | |
echo "db_dir=$DATADIR" >>"$CONFIG" |
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
install: | |
ln -sf $(PWD)/badtv.sh $(HOME)/.local/bin/ |
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
-- Quick example of how to "properly" use readPrec with a "real" parser | |
import Data.Char (isDigit, toUpper) | |
import qualified Text.ParserCombinators.ReadP as P | |
import qualified Text.Read as R | |
data WirePath = WirePath {d :: Char, a :: Int} deriving (Show) | |
instance R.Read WirePath where | |
readPrec = R.readP_to_Prec $ const $ do | |
c <- P.get |
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
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
data Handle = Handle | |
generic1 :: Handle -> Char -> Bool -> IO () | |
generic1 = undefined | |
generic2 :: Handle -> String -> Char -> Bool -> IO () |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder