Skip to content

Instantly share code, notes, and snippets.

View LeoCBS's full-sized avatar
👨‍👩‍👧‍👧

Leonardo Cesar Borges LeoCBS

👨‍👩‍👧‍👧
  • Florianópolis - SC / Brazil
View GitHub Profile
- install k8s env (node, master)
- Customaze docker path
# based from twisted doc
# https://twistedmatrix.com/documents/16.5.0/core/howto/defer.html
from twisted.internet import reactor, defer
def getDeferredObj(inputData):
print('getDeferredObj called')
deferred = defer.Deferred()
# simulate a delayed result by asking the reactor to fire the
# Deferred in 2 seconds time with the result inputData * 3
@LeoCBS
LeoCBS / main.go
Created December 14, 2024 13:09
Golang iterator example 1.23
package main
import "fmt"
// Seq is an iterator over sequences of individual values.
// When called as seq(yield), seq calls yield(v) for each value v
// in the sequence, stopping early if yield returns false.
// type Seq[V any] func(yield func(V) bool)
// our iterator function takes in a value and returns a func