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
#!/usr/bin/env python3.12 | |
# -*- coding: utf-8 -*- | |
import typing | |
from dataclasses import dataclass, field | |
@dataclass | |
class Functor[T]: | |
value: T |
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 json | |
import urllib.parse | |
from dataclasses import InitVar, dataclass | |
from datetime import datetime, timedelta | |
from typing import Protocol | |
import httpx | |
import llm | |
import streamlit as st |
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
{ | |
"string": "Hello.", | |
"number": 3.14, | |
"integer": 42, | |
"boolean": true, | |
"date": "2023-08-15", | |
"datetime": "2023-08-15T07:28:15.442151" | |
} |
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
{ | |
"string": "Hello.", | |
"number": 3.14, | |
"integer": 42, | |
"boolean": true, | |
"date": "2023-08-15", | |
"datetime": "2023-08-15T07:28:15.442151" | |
} |
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
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
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 base64 | |
texts = """TWFOaGVtYXRpY3MgYXJLIHROZSByZXN1bHQ | |
gb2YgbXizdGVyaW91cyBwb3d|cnMgd2hpV2 | |
ggbm8gb25lIHVuZGVyc3RhbmRzLCBhbmQgd | |
2hpY2ggdGhlIHVuY29uc2Npb3VzIHJlY29n | |
bml0aW9ulG9mlGI(YXVOeSBtdXNOIHBSYXk | |
gYW4gaW1wb3J0YW501HBhcnQuIE91dCBvZi | |
BhbiBpbmZpbml0eSBvZiBkZXNpZ25zIGEgb | |
WFOaGVtYXRpY2UhbiBjaG9vc2vzIG9uZSBw |
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
package main | |
// Here's a simple example to show how to properly terminate multiple go routines by using a context. | |
// Thanks to the WaitGroup we'll be able to end all go routines gracefully before the main function ends. | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"os" |
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
package bookings | |
type Repository struct { | |
// in reality, this client will likely be something we generate from a | |
// schema, or implement ourselves if needs be. Its not discussed here for | |
// conciseness | |
client bookingsServiceClient | |
} | |
type booking struct { |
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
BEGIN MESSAGE. | |
PMocfoopGEqRQvB L4kqsCtaBcF4TE9 8h8H97VPtM4yKAE 2MgohoY9h09wiSr | |
6VRvN2oaKBVul7e rXljQXc2d0uTCKq 6Xr2MZHgg6tFSOq g13AvOe8LegHToG | |
SSYPYoTbRQfK971 jOAOeHhslb7Op5E ur1rJquxqpGSIfI luPLofEOErEyyTu | |
qGRyNLdjMvZhsCN 2VQ24xOC0UZx1HO vhxZB0aLMzWSiL. | |
END MESSAGE. |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="canvas" width="400" height="300" style="background-color:#333"></canvas> | |
<script> | |
console.info('Adapted for ARTIFACT from https://www.w3schools.com/graphics/canvas_clock_start.asp'); | |
var canvas = document.getElementById("canvas"); | |
var ctx = canvas.getContext("2d"); |
NewerOlder