Skip to content

Instantly share code, notes, and snippets.

View bjartek's full-sized avatar
💭
No power in the verse can stop me

Bjarte S. Karlsen bjartek

💭
No power in the verse can stop me
  • Shiny && Find && Versus
  • Lillesand, Norway
  • X @0xBjartek
View GitHub Profile
Step 1/2 : FROM fedora:rawhide
---> 5292e27c6dac
Step 2/2 : RUN dnf --repofrompath f29-build,http://kojipkgs.fedoraproject.org/repos/f29-build/latest/x86_64/ --repo f29-build install java-10-openjdk && dnf clean all
---> Running in ab337f6a6215
Added f29-build repo from http://kojipkgs.fedoraproject.org/repos/f29-build/latest/x86_64/
f29-build 210 kB/s | 56 MB 04:31
Last metadata expiration check: 0:02:49 ago on Thu May 17 20:25:37 2018.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
ending build context to Docker daemon 3.072kB
Step 1/2 : FROM fedora:rawhide
---> 5292e27c6dac
Step 2/2 : RUN dnf --repofrompath f29-build,http://kojipkgs.fedoraproject.org/repos/f29-build/latest/x86_64/ --repo f29-build install jre-10-headless && dnf clean all
---> Running in caf86ad878ed
Added f29-build repo from http://kojipkgs.fedoraproject.org/repos/f29-build/latest/x86_64/
f29-build 258 kB/s | 56 MB 03:40
Last metadata expiration check: 0:02:49 ago on Thu May 17 20:31:52 2018.
Dependencies resolved.
================================================================================
val saleMap = listOf("foo" to 1)
val smsToGen = listOf(1)
val result: List<Pair<String, Int>> = smsToGen.mapNotNull { sms ->
val found = saleMap.find { it.second == sms }
if (found == null) {
logger.debug("adfs")
}
DEBU[0048] 🎁 GetLatestBlock called blockHeight=11 blockID=c6a3cac787516a25b81620eb7138e49ca1e8026aa4da6eff28c458924cd95d4e
DEBU[0048] 👤 GetAccount called address=192440c99cb17282
fatal error: concurrent map writes
goroutine 140 [running]:
runtime.throw(0x4d7372c, 0x15)
runtime/panic.go:1116 +0x72 fp=0xc0011b0738 sp=0xc0011b0708 pc=0x4036b92
runtime.mapassign_faststr(0x4bd6e60, 0xc00069ec60, 0xc000c25c80, 0x20, 0xc000c25c80)
runtime/map_faststr.go:211 +0x3f7 fp=0xc0011b07a0 sp=0xc0011b0738 pc=0x4015fc7
github.com/dapperlabs/flow-go/fvm/state.MapLedger.Get(...)
@bjartek
bjartek / things-i-believe.md
Created December 17, 2020 08:22 — forked from stettix/things-i-believe.md
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. See also my blog at www.janvsmachine.net.

Fundamentals

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

{
"networks": {
"emulator": {
"scripts": {
"bl0x": {
"code": "import Bl0x from 0xf8d6e0586b0a20c7\nimport MetadataViews from 0xf8d6e0586b0a20c7\n\npub fun main(address: Address, id:UInt64) : Bl0x.Metadata? {\n let account=getAccount(address)\n /* Check on bl0xPack */\n let bl0xCap = account.getCapability\u003c\u0026Bl0x.Collection{MetadataViews.ResolverCollection}\u003e(Bl0x.CollectionPublicPath)\n if !bl0xCap.check() {\n return nil\n }\n let bl0x = bl0xCap.borrow()!\n return bl0x.borrowViewResolver(id: id).resolveView(Type\u003cBl0x.Metadata\u003e())! as! Bl0x.Metadata\n}",
"spec": {
"order": [
"address",
"id"
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x14021c123e0 stack=[0x14021c12000, 0x14041c12000]
fatal error: stack overflow
runtime stack:
runtime.throw({0x10306d035?, 0x104379580?})
runtime/panic.go:992 +0x50
runtime.newstack()
runtime/stack.go:1101 +0x46c
runtime.morestack()
@bjartek
bjartek / gist:53edd58aabda8c43766a238dc952b8da
Created October 23, 2023 16:54
flow cirulating supply
1036200000
import "BasicNFT"
transaction(receiver:Address, name:String) {
prepare(signer: auth(StorageCapabilities, PublishInboxCapability) &Account) {
let storage= signer.capabilities.storage
//we issue a capability from our storage
let capability = storage.issue<&BasicNFT.Minter>(BasicNFT.minterPath)