I hereby claim:
- I am pta2002 on github.
- I am pta2002 (https://keybase.io/pta2002) on keybase.
- I have a public key ASDa7XFyrKeb33i-4icn7-jAr6cEw9SnjDuXuernQ_wYEgo
To claim this, I am signing this object:
| let mut pitch_detector = Arc::new(Mutex::new( | |
| Pitch::new( | |
| PitchMode::Yinfft, | |
| 16384, | |
| client.buffer_size().try_into().unwrap(), | |
| client.sample_rate().try_into().unwrap(), | |
| ) | |
| .expect("Failed to initialize pitch detector"), | |
| )); |
| #ifndef COLORS_H | |
| #define COLORS_H | |
| #define BOLD "\e[1m" | |
| #define DIM "\e[2m" | |
| #define UNDERLINED "\e[4m" | |
| #define BLINK "\e[5m" | |
| #define REVERSE "\e[7m" | |
| #define HIDDEN "\e[8m" | |
| import Data.List (inits, group) | |
| import Data.List.Split | |
| next :: String -> String | |
| next n | |
| | descended && hasSequence a = a | |
| | hasSequence bumped = bumped | |
| | otherwise = next bumped | |
| where | |
| (a, descended) = makeAscending n |
| local router = (require "fw.router")() | |
| router:any("/", function(req, res) | |
| res.header.content_type = "text/plain" | |
| res:write "hello world" | |
| end) | |
| router:any("/user/:name", function(req, res) | |
| res:write ("hello, " .. name) | |
| end) |
I hereby claim:
To claim this, I am signing this object:
| -- A stupid way to implement classes. | |
| -- Don't do this. | |
| local classMeta = {} | |
| function classMeta:__call(...) | |
| local obj = setmetatable({}, self) | |
| obj:new(...) | |
| return obj | |
| end | |
| function classMeta:__tostring() |
| #!/bin/env python3 | |
| # Requirements: truecolor | |
| # Usage: colorpreview [file] | |
| import truecolor | |
| import sys | |
| assert(len(sys.argv) >= 2) | |
| for filename in sys.argv[1:]: | |
| with open(filename) as file: |
| --- A simple module for dealing with strings and unicode. | |
| -- @module string | |
| -- @type String | |
| local String = {} | |
| String.__index = String | |
| local utf8 = require "utf8" | |
| --- Creates a String object. | |
| -- @tparam string text The text to encapsulate. | |
| -- @return The String object. |
| import Text.Parsec | |
| import Text.Parsec.String | |
| data Direction = U | D deriving Show | |
| data Layer = Layer Int Int Int Direction deriving Show | |
| -- parse | |
| input = [ Layer 0 3 0 U, Layer 1 2 0 U, Layer 4 4 0 U, Layer 6 4 0 U ] | |
| p_layer :: Parser Layer |
| import Data.Vector as V | |
| -- parsing | |
| parse :: String -> V.Vector Int | |
| parse = fromList . fmap read . lines | |
| run :: V.Vector Int -> Int | |
| run v = go v 0 | |
| where go v n | |
| | n < 0 || n >= V.length v = 0 |