Stuff I did
Here is some of the stuff I did over the years
import type { PathLike } from "fs"; | |
import fs from "fs"; | |
import path, { parse } from "path"; | |
import * as E from "fp-ts/lib/Either"; | |
import { pipe } from "fp-ts/function"; | |
import { object } from "firebase-functions/v1/storage"; | |
import { objectHasProp } from "~/lib/utils"; | |
import * as IE from "fp-ts/IOEither"; | |
main(); |
-- This is from https://www.linkedin.com/learning/learning-sql-programming-8382385/ | |
-- There where no postgres so I adjusted it to work strait up. | |
CREATE TABLE states ( | |
state_name VARCHAR(50), | |
state_abbrev CHAR(2), | |
region VARCHAR(50), | |
division VARCHAR(50) | |
); |
{- | |
I got frustrated about how Http.get works, so I expanded all the function in Elm core to get to the bottom of line | |
-} | |
expectJson : (Result Error a -> msg) -> Decode.Decoder a -> Expect msg | |
expectJson toMsg decoder = | |
let | |
decodingResult string = | |
case (Decode.decodeString decoder string) of | |
Ok v -> | |
Ok v |
module Main exposing (..) | |
-- This code needs following dependencies: | |
-- elm/browser 1.0.2 | |
-- elm/html 1.0.0 | |
-- elm/http 2.0.0 | |
-- elm/json 1.1.3 | |
-- elm/random 1.0.0 | |
-- krisajenkins/remotedata 6.0.1 | |
-- NoRedInk/elm-json-decode-pipeline/ 1.0.1 | |
-- Can try it here: https://ellie-app.com/nBCdHpv2jRta1 |
module Main exposing (..) | |
type alias Bar = | |
{ baz : String } | |
type alias Foo = | |
{ bar : Bar } |
Here is some of the stuff I did over the years
import { createFactory, Component } from 'react' | |
export const withContext = (childContextTypes, getChildContext) => BaseComponent => { | |
const factory = createFactory(BaseComponent) | |
class WithContext extends Component { | |
getChildContext = () => getChildContext(this.props) | |
render() { | |
return factory(this.props) | |
} |
curl -s https://api.github.com/repos/roc-lang/roc/releases|jq -r '.[0].assets [0].browser_download_url'|xargs -n1 -I % curl -L % --output roc_nightly.tar.gz |
based on https://www.reddit.com/r/vim/comments/24g8r8/italics_in_terminal_vim_and_tmux/
$ echo -e "\e[3mitalic\e[23m"
$ infocmp $TERM | grep sitm
sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,