Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
@preslavrachev
preslavrachev / do.go
Last active August 4, 2022 13:15
Do is an experiment in mimicking the Result type (known from languages like Rust and Haskell). The idea is to minimize the amount of error checking and let the developer focus on the happy path, without undermining the power of Go's errors. The code below requires Go 1.18+, as it makes use of generic type parameters.
package do
type Void struct{}
type Result[T any] interface {
Unwrap() (T, error)
}
type defaultResult[T any] struct {
val T
@catrielmuller
catrielmuller / README.md
Last active May 12, 2024 17:56
ArchLinux ElGato FaceCam - Chrome V4L2Loopback

ArchLinux ElGato FaceCam - Chrome V4L2Loopback

IMPORTANT

This is not required any more, you need upgrade your firmware to the version +4.09 using ElGato Cammera Hub

https://help.elgato.com/hc/en-us/articles/4406041241997-Elgato-Facecam-Firmware-Update

Changes in firmware 4.09

  • Added MJPEG as a fallback video format. MJPEG requires less USB bandwidth and improves compatibility with programs that cannot handle uncompressed video.
@rcshubhadeep
rcshubhadeep / main.go
Created July 21, 2021 18:12
full code
package main
import (
"errors"
"fmt"
"strconv"
"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/multi"
)
@michaeljs1990
michaeljs1990 / main.go
Created July 17, 2020 05:26
Bleve _source example
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index/scorch"
@mingfang
mingfang / shell.go
Created November 10, 2019 04:12
Cadence activity to execute shell commands
package main
import (
"context"
"flag"
"os"
"os/exec"
"go.uber.org/cadence/.gen/go/cadence/workflowserviceclient"
"go.uber.org/cadence/activity"

AM - AtoM Docker Compose integration

Connect AM and AtoM Docker Compose environments using a shared external volume and other tweaks needed to test and develop DIP uploads between both applications.

  1. Setup both Docker Compose environments independently:

  2. Create local folder and Docker volume:

I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@adymitruk
adymitruk / trello-cqrs-es.fish
Last active October 23, 2023 20:19
Trello in CQRS/ES in fish shell
#set up the dir structure if it doesn't exist
set t ~/.trello; mkdir -p $t
function if_exist # we don't want to litter our code with ifs if a read model or events are not there yet. Return /dev/nul for empty
if test -e $t/$argv[1]; echo $t/$argv[1]; else; echo /dev/null; end
end
function list # provide lists from our tab delimited entries with filtering and line item numbers to make choices
set list $argv[1]; set column_to_show $argv[2]; set filter $argv[3]; set count 1
cat (if_exist $list) | grep -e "$filter\$" | while read line
set -l line_items (string split \t $line)
echo $count\) $line_items[$column_to_show]
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 26, 2024 01:19
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).