Skip to content

Instantly share code, notes, and snippets.

@cretz
cretz / README.md
Created April 12, 2023 14:30
Demonstration of Temporal payload codec and payload converter applying to specific object

Putting all these files in my_folder and running python -m my_folder.main gives:

Called activity with MySpecialObject(foo='some-foo-val')
Called activity with some-other-val

And when reviewing the history, you can see the special encoding/object:

@cretz
cretz / define_workflow.py
Created August 16, 2022 20:39
Simple Python Gists
@workflow.defn
class SayHello:
@workflow.run
async def run(self, name: str) -> str:
return f"Hello, {name}!"
@cretz
cretz / main.go
Last active June 14, 2018 19:25
Chromecast Server in Go (fails unless authCert gen'd w/ Google-owned CA)
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/binary"
@cretz
cretz / README.md
Created April 10, 2018 21:11
Gradle Build for Sandbox ADBA

Below is a build.gradle file that can be placed adjacent to the src directory when downloading the ADBA source. When assemble is executed via Gradle it will build the Java 9 module that can be used. I am currently using this for my Postgres ADBA work on PgNio.

{
"violatingSites": [
{
"reviewedSite": "blabbermouth.net",
"mobileSummary": {},
"desktopSummary": {
"lastChangeTime": "2017-11-16T20:26:04.838911001Z",
"region": [
"REGION_A"
],
@cretz
cretz / parsers.md
Created October 5, 2017 21:22
Some Parsers/Writers/Translators I Wrote
@cretz
cretz / CLA.md
Created September 6, 2017 15:41

Doogie Individual Contributor Non-Exclusive License Agreement

including the Patent Pledge OPTION

(generated with help from http://contributoragreements.org)

Thank you for your interest in contributing to Doogie ("We" or "Us"). The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us. To make this document effective, please follow the instructions at https://github.com/cretz/doogie.

@cretz
cretz / kotlin-annoyances.md
Last active November 12, 2019 22:54
Kotlin Annoyances

Kotlin Annoyances

These are things that I found annoying writing a complex library in Kotlin. While I am also a Scala developer, these should not necessarily be juxtaposed w/ Scala (even if I reference Scala) as some of my annoyances are with features that Scala doesn't even have. This is also not trying to be opinionated on whether Kotlin is good/bad (for the record, I think it's good). I have numbered them for easy reference. I can give examples for anything I am talking about below upon request. I'm sure there are good reasons for all of them.

  1. Arrays in data classes break equals/hashCode and ask you to overload it. If you are going to need to overload it and arrays have no overridability, why not make the least-often use case (the identity-comparison equals) the exception?
package asmble.ast
import asmble.util.Either
sealed class SExpr {
data class Multi(val vals: List<SExpr> = emptyList()) : SExpr()
data class Symbol(val contents: String = "", val quoted: Boolean = false) : SExpr()
companion object {
data class ParseError(val charOffset: Int, val msg: String)