Skip to content

Instantly share code, notes, and snippets.

View risingBirdSong's full-sized avatar

peter risingBirdSong

  • PNW
View GitHub Profile
-- unwrapping exercise, the goal is to print the contents of the IO
newtype MyActionThing a
= MyActionThing
{ runMyActionThing :: IO a
}
action :: MyActionThing Int
newtype ExceptT e m a
= ExceptT
{ runExceptT :: m (Either e a)
Checking IHP files:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
--linear search
findNumSorted srch (x:xs)
| srch == x = Just x
| x > srch = Nothing
| otherwise = findNumSorted srch xs
--make a binary tree
data MyTree a = EmptyTree | Node a (MyTree a) (MyTree a) deriving (Show, Read, Eq)
singleton x = Node x EmptyTree EmptyTree
//pick from nodeConfig those relating to animation
type animToPick = Pick<NodeConfig, "x" | "y" | "width" | "height" | "opacity" | "scaleX" | "scaleY" | "rotation" | "rotationDeg" | "offsetX" | "offsetY">
interface nodeAndFinish {
// the values that failed travis tests
node: Node;
onfinish: Function;
}
interface animToSpecific {
//and other possible methods / properties go here
to: (params: animOptions) => void;
interface animOptions {
x?: number
y?: number;
height?: number;
width?: number;
skewX?: number;
skewY?: number;
scaleY?: number;
import * as React from "react";
import Konva from "konva";
import {
Star,
} from "react-konva";
interface PlayState {
x: number;
y: number;
}
//https://www.html5canvastutorials.com/tutorials/html5-canvas-wrap-text-tutorial/
function wrapText(context, text, x, y, maxWidth, lineHeight) {
var words = text.split(" ");
var line = "";
for (var n = 0; n < words.length; n++) {
var testLine = line + words[n] + " ";
var metrics = context.measureText(testLine);
var testWidth = metrics.width;
import { config } from "./config";
import fs from "fs";
import * as fileHelpers from "./helper";
import request from "request";
convertTextToSpeech("In mindfulness practice, we are learning how to return to the moment");
function convertTextToSpeech(inputText: string) {
const authRequestOptions: request.CoreOptions = {
headers: {
[
{
"title": "Refined Metal Table",
"description": "Incredible customized lavender Wooden",
"numberOfAnsweredQuestions": 0,
"amazonsChoice": false,
"primeDiscount": "0",
"rating": 5,
"numberOfRatings": 0,
"currentPrice": 18,