Skip to content

Instantly share code, notes, and snippets.

View shapr's full-sized avatar
🏃
VENTRE À TERRE

Shae Erisson shapr

🏃
VENTRE À TERRE
View GitHub Profile
import time
import board
import pwmio
led = pwmio.PWMOut(board.A1, frequency=5000, duty_cycle=0)
while True:
for i in range(100):
# PWM LED up and down
if i < 50:
@shapr
shapr / adafruit_httpserver.py
Created May 12, 2022 03:03
add parameter parsing to adafruit httpserver
# SPDX-FileCopyrightText: Copyright (c) 2022 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_httpserver`
================================================================================
Simple HTTP Server for CircuitPython
@shapr
shapr / code.py
Last active May 16, 2022 03:33
adafruit funhouse with httpserver for setting fibonacci 256 colors
# SPDX-FileCopyrightText: 2022 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
from secrets import secrets # pylint: disable=no-name-in-module
from rainbowio import colorwheel
import binascii
import board
import microcontroller
module Demo where
-- notice many of these don't have type signatures.
-- Haskell is smart enough figure out 99% of the type signatures for you.
-- any type signatures here are just to add clarity.
-- number
somenumber = 1
-- string
@shapr
shapr / hpc.torrent.eventlog.txt
Created April 19, 2022 17:46
ghc-eventlog-socket output sent to ghc-events inc
This file has been truncated, but you can view the full file.
Up to date
320205218: cap 0: running thread 14
320219671: cap 0: stopping thread 14 (thread yielding)
320220960: cap 0: running thread 14
320226864: cap 0: stopping thread 14 (making a foreign call)
320270050: cap 0: requesting parallel GC
322755595: cap 0: starting GC
322765713: cap 0: GC working
322927933: cap 0: GC idle
322931427: cap 0: GC working
@shapr
shapr / runner.nix
Created April 16, 2022 22:33
define, build, and load docker container via nix?
virtualisation.oci-containers = {
backend = "docker";
containergs = {
our-container-image = {
autoStart = false;
image = "our-container-image";
imageFile = pkgs.dockerTools.buildImage {
name = "our-container-image";
contents = with pkgs; [ git git-lfs gitlab-runner ];
};
@shapr
shapr / QuickCheck.hs
Created April 7, 2022 17:39
fails as expected
#!/usr/bin/env cabal
{- cabal:
build-depends: base
, QuickCheck
-}
module Main where
import Test.QuickCheck
@shapr
shapr / HedgeHog.hs
Created April 7, 2022 17:36
hedgehog WHAT?
#!/usr/bin/env cabal
{- cabal:
build-depends: base
, hedgehog
-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
@shapr
shapr / blinky.v
Created April 2, 2022 01:14
verilog blinky
module bar (
clk,
rst,
dout
);
parameter buswidth = 8;
parameter n = 4;
input clk;
{
viewer {
following(first: 50) {
pageInfo {
endCursor
hasNextPage
}
totalCount
nodes {
login