[email protected] LinkedIn Github
This file contains 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
-- 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) |
This file contains 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
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) |
This file contains 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
--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 |
This file contains 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
//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 |
This file contains 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
to: (params: animOptions) => void; | |
interface animOptions { | |
x?: number | |
y?: number; | |
height?: number; | |
width?: number; | |
skewX?: number; | |
skewY?: number; | |
scaleY?: number; |
This file contains 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
import * as React from "react"; | |
import Konva from "konva"; | |
import { | |
Star, | |
} from "react-konva"; | |
interface PlayState { | |
x: number; | |
y: number; | |
} |
This file contains 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
//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; |
This file contains 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
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: { |
This file contains 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
[ | |
{ | |
"title": "Refined Metal Table", | |
"description": "Incredible customized lavender Wooden", | |
"numberOfAnsweredQuestions": 0, | |
"amazonsChoice": false, | |
"primeDiscount": "0", | |
"rating": 5, | |
"numberOfRatings": 0, | |
"currentPrice": 18, |
NewerOlder