Skip to content

Instantly share code, notes, and snippets.

View lucasjellema's full-sized avatar

Lucas Jellema lucasjellema

View GitHub Profile
@lucasjellema
lucasjellema / TagComponent.vue
Created July 23, 2024 06:31
Custom Vuetify components for editing tags
<template>
<v-autocomplete clearable chips closable-chips v-model="selectedTags" :items="filteredTags" multiple
item-title="name" item-value="name" auto-select-first hide-no-data hide-selected small-chips
label="Voeg tags toe" append-icon="mdi-tag-plus" @blur="handleBlurOnTags" :custom-filter="customFilter"
@update:model-value="handleSelectionUpdate" clear-on-select ref="autocompleteRef" class="ma-0 mt-5">
<!-- selected items -->
<template v-slot:chip="{ props, item }">
<v-chip v-bind="props" :text="item.raw.name"></v-chip>
</template> <!-- to select -->
<template v-slot:item="{ props, item }">
@lucasjellema
lucasjellema / pancake-party-0.js
Last active June 24, 2024 07:07
Simulating a birthday party where pancakes are served - this gist describes a naïve approach (no parallel or aysnchronous processing, no use of pipelining) and a smart approach (where those mechanisms are employed). The code demonstrates the use of asynchronous generators in combination with promises.
// pancake party for my son's birthday
// I have promised him pancakes. Each pancake has to be baked, decorated (syrup, sugar, jam, ..) and sliced (in bite size sections)
const numberOfGuests = 8
// assuming each guest eats exactly three pancakes
const totalNumberOfPancakes = numberOfGuests * 3
const numberOfPans = 1
// times in milliseconds
const timeToBakeOnePancake = 3000;
@lucasjellema
lucasjellema / readme.md
Last active December 5, 2023 09:22
OCI NoSQL Database SQL

To create the table, we need a DDL statement - it still feels weird to say stuff like that regarding a NoSQL database

CREATE TABLE TWEETS_TABLE(id LONG, text STRING, author STRING, tweet_timestamp TIMESTAMP(0), language STRING, hashtags STRING, PRIMARY KEY(SHARD(id))) USING TTL 1 DAYS

This can be done in OCI CLI. It is convenient to first set the compartment OCID

export COMPARTMENT_OCID=ocid................................

Then:

@lucasjellema
lucasjellema / build_specification.yaml
Last active April 24, 2023 09:58
function tweetretriever build specification file
version: 0.1
component: build
timeoutInSeconds: 6000
runAs: root
shell: bash
env:
# these are local variables to the build config
variables:
FUNCTION_DIRECTORY: "tweet_retriever_source/functions/tweet-summarizer"
# # the value of a vaultVariable is the secret-id (in OCI ID format) stored in the OCI Vault service

Conclusion Code Cafe - 17th November 2022 - Handson

Three handson labs:

  • Backstage
  • Gitpod
  • OpenTelemetry

Backstage

The Backstage handson provides a Gitpod workspace in which a Backstage instance can be easily installed and explored. The handson instruction has some references to tutorials that help you look around Backstage.

@lucasjellema
lucasjellema / docker-compose.yml
Created May 22, 2018 04:57
Docker Compose file for Apache Kafka, the Confluent Platform (4.1.0) - with Kafka Connect, Kafka Manager, Schema Registry and KSQL (1.0) - assuming a Docker Host accessible at 192.168.188.102
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:4.1.0"
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@lucasjellema
lucasjellema / Vagrantfile
Last active May 26, 2022 05:23
Vagrantfile for creating and running an Ubuntu VM with large disk, preconfigured IP address, provisioned Docker and Docker Compose
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
@lucasjellema
lucasjellema / objectstorage.go
Last active December 31, 2021 11:39
Dapr custom state store on OCI ObjectStorage
/*
OCI Object Storage state store.
Sample configuration in yaml:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
@lucasjellema
lucasjellema / objectstorage.go
Created December 28, 2021 13:39
SkeletonStateStoreComponent
/*
OCI Object Storage state store.
Sample configuration in yaml:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
@lucasjellema
lucasjellema / main.go
Last active December 28, 2021 12:08
OCI Go SDK ObjectStorag explorations
package main
import (
"context"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"