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 DeriveFunctor #-} | |
{-#LANGUAGE ExistentialQuantification #-} | |
{-#LANGUAGE FlexibleInstances #-} | |
{-#LANGUAGE ScopedTypeVariables #-} | |
module Main where | |
import Data.List | |
import Data.Maybe | |
import Data.Void | |
import Numeric.Natural |
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
#!/bin/sh | |
# It's not so clear how to use idl_compiler.py, and the .gyp/.gn files are fairly | |
# opaque (not to mention the "Global Information" section of | |
# https://www.chromium.org/developers/design-documents/idl-compiler#TOC-Global-information | |
# isn't even filled out... oh well). | |
set -e | |
echo "Generating core-files-list.txt..." | |
find core -name \*.idl ! -name InspectorInstrumentation.idl >core-files-list.txt |
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
module Main | |
import Data.Vect | |
listToVect : List a -> (n ** Vect n a) | |
listToVect [] = (0 ** []) | |
listToVect (a :: as) with (listToVect as) | |
| (n ** as') = (1 + n ** a :: as') | |
stringToVect : String -> (n ** Vect n Char) |
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 strict'; | |
var assert = require('assert'); | |
var util = require('util'); | |
var DEFAULT_TIMEOUT = 200; | |
// Abstract Syntax Tree for Defining Tests | |
// ---------------------------------------------------------------------------- |
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
SRC_MD_FILES=$(shell find src -name \*.md) | |
MD_FILES=$(SRC_MD_FILES:src/%=%) | |
HTML_FILES=$(MD_FILES:.md=.html) | |
BUILD_HTML_FILES=$(HTML_FILES:%=build/%) | |
all: $(BUILD_HTML_FILES) | |
build/%.html: src/%.md | |
mkdir -p $$(dirname $@) | |
pandoc -o $@ $? |
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
#!/bin/sh | |
HTTP_PORT=9090 | |
WS_PORT=9091 | |
echo "HTTP/1.1 302 Found\r\nLocation: http://localhost:${WS_PORT}\r\nContent-Length: 0\r\n" | nc -l ${HTTP_PORT} & | |
wscat -l ${WS_PORT} & | |
wscat -c ws://localhost:${HTTP_PORT} |
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 DataKinds #-} | |
{-#LANGUAGE KindSignatures #-} | |
{-#LANGUAGE TypeFamilies #-} | |
{-#LANGUAGE TypeOperators #-} | |
{-#LANGUAGE UndecidableInstances #-} | |
{-#LANGUAGE ViewPatterns #-} | |
module Main where | |
import Data.Functor.Identity |
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 DataKinds #-} | |
{-#LANGUAGE DeriveDataTypeable #-} | |
{-#LANGUAGE DeriveFoldable #-} | |
{-#LANGUAGE DeriveFunctor #-} | |
{-#LANGUAGE DeriveGeneric #-} | |
{-#LANGUAGE DeriveTraversable #-} | |
{-#LANGUAGE GADTs #-} | |
{-#LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-#LANGUAGE KindSignatures #-} | |
{-#LANGUAGE TypeFamilies #-} |
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
class Option(object): | |
def __init__(self, is_defined, value=None): | |
self.is_defined = is_defined | |
if is_defined: | |
self.value = value | |
@classmethod | |
def Some(cls, value): | |
return Option(True, value) |
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
object Chunked { | |
def getItems(start: Int, count: Int): List[Int] = { | |
// Simulate doing I/O to get the items. | |
val items = List.range(start*count, (start*count)+count) | |
println(s"> Database returned: ${items}") | |
items | |
} | |
def chunked(count: Int): Stream[Int] = { |
NewerOlder