Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
focused

Sören Martius soerenmartius

🎯
focused
View GitHub Profile
View gist:19057f8caeeca56a7e652a0aa7247ff2
{
"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": "soeren.martius@master-nodes.io",
@soerenmartius
soerenmartius / _src_modules_auth_store_index.ts
Last active Sep 19, 2020
Vue 3 with Typescriptt and Vuex 4 Typed Modules Examples ( with real types )
View _src_modules_auth_store_index.ts
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
@soerenmartius
soerenmartius / custom_validation_rules.tf
Created Jun 9, 2020
Terraform Custom Validation Rule Examples
View custom_validation_rules.tf
## 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 {
View processes-vs-threads.csv
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
Multiprocessing Example in Python3
View multi_processing.py
import multiprocessing
def spawn_process(number):
print(f'Runs in separate process {number}')
if __name__ == '__main__':
max_processes = 5
@soerenmartius
soerenmartius / multithreading.go
Created May 5, 2020
Multithreading Example with WaitGroups in Golang
View multithreading.go
package main
import (
"fmt"
"sync"
"time"
)
func worker(wg *sync.WaitGroup, id int) {
defer wg.Done()
@soerenmartius
soerenmartius / repository.tf
Last active Mar 29, 2020
GitHub Repository with Branch Protection Rule
View repository.tf
module "iac-github" {
source = "mineiros-io/repository/github"
version = "~> 0.1.0"
name = "iac-github"
private = true
description = "An example on how to manage a GitHub organization with Terraform."
allow_merge_commit = true
@soerenmartius
soerenmartius / deploy.yml
Last active Mar 29, 2020
SemaphoreCI Terraform Deployment Pipeline.
View deploy.yml
version: v1.0
name: "Deploy to GitHub"
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
global_job_config:
env_vars:
- name: BUILD_TOOLS_VERSION
@soerenmartius
soerenmartius / semaphore.yml
Created Mar 29, 2020
SemaphoreCI Pipeline Configuration
View semaphore.yml
version: v1.0
name: "IaC-Github CI Pipeline"
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
global_job_config:
env_vars:
- name: BUILD_TOOLS_VERSION
@soerenmartius
soerenmartius / repository.tf
Created Mar 29, 2020
Create new GitHub Repository with Terraform
View repository.tf
module "iac-github" {
source = "mineiros-io/repository/github"
version = "~>0.1.0"
name = "iac-github"
private = true
description = "An example on how to manage a GitHub organization with Terraform."
allow_merge_commit = true
You can’t perform that action at this time.