Skip to content

Instantly share code, notes, and snippets.

View soerenmartius's full-sized avatar
🎯
focused

Sören Martius soerenmartius

🎯
focused
View GitHub Profile
@soerenmartius
soerenmartius / backend.tf
Created May 5, 2022 12:26
backend.tf file generated by Terramate
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT
// TERRAMATE: originated from generate_hcl block on /stacks/config.tm
terraform {
backend "gcs" {
bucket = "my-state-bucket"
prefix = "stacks/gcp-projects/my-staging/my-vpc"
}
}
@soerenmartius
soerenmartius / advanced_example_config.tm.hcl
Created May 5, 2022 12:24
This example shows some advanced features of Terramate.
# file: stacks/config.tm
globals {
# define a bucket name that is used when generating backend.tf defined below
gcs_bucket_name = "my-state-bucket"
# the following will calculate the path name of each stack
# but remove the / prefix as gcs does not handle this well
gcs_bucket_prefix = tm_substr(terramate.path, 1, -1)
}
@soerenmartius
soerenmartius / example_stack.tm.hcl
Created May 5, 2022 12:22
This Example shows how to define a basic stack with Terramate
stack {
name = "My stack"
description = "My stack description"
}
# Set default shell to bash
SHELL := /bin/bash -o pipefail
BUILD_TOOLS_VERSION ?= v0.5.3
BUILD_TOOLS_DOCKER_REPO = mineiros/build-tools
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}
TERRAFORM_PLANFILE ?= out.tfplan
ifndef NOCOLOR
@soerenmartius
soerenmartius / module.ts
Last active October 12, 2023 09:30
vuex 4 cognito module
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
@soerenmartius
soerenmartius / gist:19057f8caeeca56a7e652a0aa7247ff2
Last active October 8, 2020 07:18
strongblock node definition
{
"address": "0xd4f83Fc6a0f0Ed1799C4f26279405fA91BAc2BbC",
"name": "Master-Nodes.io Strongblock I",
"logo": "https://www.master-nodes.io/wp-content/uploads/2018/10/master-nodes-io-logo.png",
"description": "We love Masternodes!",
"website_url": "https://www.master-nodes.io",
"rpc_endpoint": "http://eth-mainnet.master-nodes.io:8545",
"ws_endpoint": "ws://eth-mainnet.master-nodes.io:8546",
"location": "Germany",
"email": "[email protected]",
@soerenmartius
soerenmartius / _src_modules_auth_store_index.ts
Last active June 29, 2023 02:28
Vue 3 with Typescriptt and Vuex 4 Typed Modules Examples ( with real types )
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
@soerenmartius
soerenmartius / custom_validation_rules.tf
Created June 9, 2020 14:40
Terraform Custom Validation Rule Examples
## Custom Validation Rule Examples
variable "alias_attributes" {
type = set(string)
description = "(Optional) Attributes supported as an alias for this user pool. Possible values: 'phone_number', 'email', or 'preferred_username'."
default = [
"email",
"preferred_username",
]
validation {
Process Thread
Processes are heavy-weight operations. Threads are lighter-weight operations.
Processes can start new processes using e.g. [fork()](http://man7.org/linux/man-pages/man2/fork.2.html) (system call). A process can start several threads using e.g [pthread_create()](http://man7.org/linux/man-pages/man3/pthread_create.3.html) (system call).
Each process lives in its own memory (address) space and holds a full copy of the program in memory which consume more memory. Processes don’t share memory with other processes. Threads share memory with other threads of the same process. Threads within the same process live within the same address space and can thus easily access each other's data structures. The shared memory heaps and pools allow for reduced overhead of shared components.
Inter-process communication is slow as processes have different memory addresses. Inter-thread communication can be faster than inter-process communication because threads of the same process share memory with the process they
@soerenmartius
soerenmartius / multi_processing.py
Created May 5, 2020 09:54
Multiprocessing Example in Python3
import multiprocessing
def spawn_process(number):
print(f'Runs in separate process {number}')
if __name__ == '__main__':
max_processes = 5