Skip to content

Instantly share code, notes, and snippets.

Mark Watson mkwatson

Block or report user

Report or block mkwatson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.clj
(defmulti sell-booze (fn [store person] [(over-21? person) (enough-supply? store) (enough-money? person)])
View example.sh
curl -X GET 'https://api.twitch.tv/helix/users?login=dignitas' \
-H 'Client-ID: kimne78kx3ncx6brgo4mv6wki5h1ko'
@mkwatson
mkwatson / Mod.idr
Last active Jul 13, 2018
Hoping to prove some things about modular congruences
View Mod.idr
%default total
{-
A few notes:
* I think maybe this should be called a Quotient Type
* There's a few fns where I'd ike to pattern match on n=(m ** prf) but instead am using fst and snd
-}
data Mod : (m ** Not (m = Z)) -> Type where
MkMod : (n : Nat) -> Mod m
View holesWithRewrites.idr
myReverse : Vect n elem -> Vect n elem
myReverse [] = []
myReverse {n = S k} (x :: xs)
= let result = myReverse xs ++ [x] in
rewrite plusCommutative 1 k in ?myReverse_rhs_2
{- my holes
elem : Type
k : Nat
x : elem
@mkwatson
mkwatson / README.md
Last active Sep 14, 2017
Verifying and Decrypting notes
View README.md

Generate data

This is handled by AT&T, but we can replicate it for development and testing

Generate self-signed key and certificate

Used for signing the data.

Bash command:

> openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
View Test Ethereum Wallet
0x4FE5c0E5aA85E4736f1144cD649bd04acaaEFb82
View jws.json
{
"payload": <data>,
"signatures": [
<signature 1>,
<signature 2>,
...
]
}
View testy.sh
docker-compose build
# > ERROR: Couldn't find env file: /Users/mawatson/Repositories/oneID-connect-reference-project-server/env.list
pwd
# > /Users/mawatson/Repositories/oneID-connect-reference-project-server
find . -name 'env.list'
# >
docker build .
# > ...
docker pull postgres
# > ...
View DataframeByRow.scala
case class Person(name: String, age: Long, ttl: Long)
val caseClassDF = Seq(Person("Andy", 32, 5000000), Person("Mark", 27, 1000000)).toDF()
caseClassDF.show()
// +----+---+-------+
// |name|age| ttl|
// +----+---+-------+
// |Andy| 32|5000000|
// |Mark| 27|1000000|
View test.clj
(reduce + (range 1000000000))
You can’t perform that action at this time.