Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import re
import sys
import time
import subprocess
import multiprocessing
import termplotlib as tpl
import numpy as np
@thoughtpolice
thoughtpolice / ecp5pll.py
Last active March 18, 2024 12:31
Yosys script to generate ECP5 PLLs on the fly
# ecp5pll.py: yosys RPC frontend for generating ECP5 PLL modules on the fly
#
# Copyright (C) 2020 Austin Seipp
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
theory
Consensus_Demo
imports
Network
begin
datatype 'val msg
= Propose 'val
| Accept 'val
@dysinger
dysinger / README.lhs
Last active February 9, 2022 18:07
Single-file executable literate Haskell with Stack
#!/usr/bin/env stack
> -- stack --resolver lts-6 --install-ghc runghc --package classy-prelude --package lens --package wreq
Blah Blah words about this single file executable README goes here.
> {-# LANGUAGE DeriveAnyClass #-}
> {-# LANGUAGE DeriveGeneric #-}
> {-# LANGUAGE NoImplicitPrelude #-}
> {-# LANGUAGE OverloadedStrings #-}
@rschatz
rschatz / webapp.hs
Last active August 29, 2015 14:16
more playing around with servant (featuring different monads and cookies)
-- application specific monads and types
type ServerMonad a
type SessionMonad a
runServerMonad :: ServerContext -> ServerMonad a -> IO (Either (Int,String) a)
authenticated :: AuthData -> SessionMonad a -> ServerMonad a
data AuthData
data AuthResponse a

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <[email protected]> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*