Skip to content

Instantly share code, notes, and snippets.

View fcracker79's full-sized avatar
🎯
Focusing

Mirko Bonasorte fcracker79

🎯
Focusing
View GitHub Profile
@fcracker79
fcracker79 / gist:0e706e8d9309595ba40119c292d82f57
Created December 6, 2021 08:17
My testnet configuration for Cardano
{
"AlonzoGenesisFile": "testnet-alonzo-genesis.json",
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874",
"ApplicationName": "cardano-sl",
"ApplicationVersion": 0,
"ByronGenesisFile": "testnet-byron-genesis.json",
"ByronGenesisHash": "96fceff972c2c06bd3bb5243c39215333be6d56aaf4823073dca31afe5038471",
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 0,
@fcracker79
fcracker79 / gist:ec283cdb9a57d2d4b9f771a5d268f19e
Last active December 14, 2022 07:32
Optional and switch
public class TestOptional {
private sealed interface MyOptional<T> {
MyOptional<?> EMPTY = new MyEmpty<>();
boolean hasValue();
T get();
static <T> MyOptional<T> of(T t) {
return new MyJust<>(t);
}
@fcracker79
fcracker79 / gist:ebe07a4209caf5863409aed8758ed81c
Created May 3, 2023 11:58
Using OpenAI to convert SQL to ES queries
You are a great Elasticsearch expert.
I will provide an SQL query on a table named "ES_TABLE".
You will convert that SQL query to an ElasticSearch query.
SQL Query:
```
SELECT f1, f2, SUM(f3)
FROM ES_TABLE
WHERE f1 BETWEEN 'a' AND 'b'
GROUP BY f1, f2
```
@fcracker79
fcracker79 / gist:4f9d63106ad4c422d4f440450da18060
Created July 13, 2023 16:56
Play with interfaces and zero-value objects
package main
import (
"errors"
"fmt"
)
type MyError string
func (e MyError) Error() string {
@fcracker79
fcracker79 / deadlock.go
Created August 2, 2023 06:40
Errata Concurrency in Go chapter 3, page 56
package main
import (
"fmt"
"sync"
"time"
)
type Button struct {
Clicked *sync.Cond