This file contains hidden or 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 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 | |
*/ |
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.
Keep it simple, stupid. You ain't gonna need it.
This file contains hidden or 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 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) |
- Generated by code-examples-manager release 2.4.9-SNAPSHOT
- 659 published examples
- akka-actors-hello-world.sc : Simple akka hello world example
- akka-capitalize-and-print.sc : dump capitalized string coming from stdin using streams
- akka-http-client-json-stream.sc : Fully asynchronous http client call with json streamed response using akka-http will work in all cases, even with chunked responses !
- akka-http-client-json-with-proxy.sc : Fully asynchronous http client call with json response using akka-http will work in all cases, even with chunked responses, this example add automatic http proxy support.
- [akka-http-client-json.sc](https:/
This file contains hidden or 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
-- 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, |
This file contains hidden or 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
Git Actions: CI System Actions: | |
+-------------------------+ +-----------------+ | |
+--► Create a Feature Branch | +---► Build Container | | |
| +------------+------------+ | +--------+--------+ | |
| | | | | |
| | | | | |
| +--------▼--------+ | +-------▼--------+ | |
| +---► Push the Branch +-------+ | Push Container | | |
| | +--------+--------+ +-------+--------+ |
This file contains hidden or 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
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) |
This file contains hidden or 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
# -*- 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 |