Skip to content

Instantly share code, notes, and snippets.

import scala.util.Try
/**
* Alternative to unsound construct: "sealed abstract case class"
* see https://gist.github.com/tpolecat/a5cb0dc9adeacc93f846835ed21c92d2
* The solution below is the summary of the comments of the above gist.
*
* Works as is in Scala 2.12 and higher
* In Scala 2.11.12 you have to add -Xsource:2.12
*/
@stettix
stettix / things-i-believe.md
Last active May 4, 2025 13:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

package net.degoes.zio
trait Sql {
type ColumnName
type TableName
sealed trait Table[+A]
/**
* (SELECT *, "foo", table.a + table.b AS sum... FROM table WHERE cond) UNION (SELECT ... FROM table)
@dacr
dacr / index.md
Last active May 11, 2025 11:26
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/6e82bf2949cc61c919535ce35a58ebc93721c33

David's programming examples knowledge base

akka-pekko

@kbuzzard
kbuzzard / imo2019q1.lean
Last active February 24, 2023 18:22
IMO 2019 Q1 solution formalised in Lean
-- this was compiling with mathlib in June 2020
import tactic
theorem imo2019Q1 (f : ℤ → ℤ) :
(∀ a b : ℤ, f (2 * a) + 2 * (f b) = f (f (a + b))) ↔
(∀ x, f x = 0) ∨ ∃ c, ∀ x, f x = 2 * x + c :=
begin
split, swap,
{ -- easy way: f(x)=0 and f(x)=2x+c work.
intro h,
Git Actions: CI System Actions:
+-------------------------+ +-----------------+
+--► Create a Feature Branch | +---► Build Container |
| +------------+------------+ | +--------+--------+
| | | |
| | | |
| +--------▼--------+ | +-------▼--------+
| +---► Push the Branch +-------+ | Push Container |
| | +--------+--------+ +-------+--------+
@rob-brown
rob-brown / SecretMessage.exs
Last active June 7, 2021 14:48
Encode secret messages into text using zero-width spaces
defmodule SecretMessage do
@zero "\u200C"
@one "\u200D"
def encode(text, secret) when byte_size(text) > byte_size(secret) do
secret
|> obfuscate
|> Stream.concat(Stream.repeatedly fn -> "" end)
|> Stream.zip(String.codepoints text)
@gdamjan
gdamjan / ssl-check.py
Last active April 14, 2024 07:16
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket