Skip to content

Instantly share code, notes, and snippets.

View yordis's full-sized avatar
💜
Helping people one second at the time

Yordis Prieto yordis

💜
Helping people one second at the time
View GitHub Profile
@StephenBrown2
StephenBrown2 / simple_txn_struct.go
Last active June 8, 2021 06:33
Simple transaction struct format from json
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse and unparse this JSON data, add this code to your project and do:
//
// txns, err := UnmarshalTransactionList(bytes)
// bytes, err = txns.Marshal()
package main
import "encoding/json"

System Architecture Course

This course provides a structured approach for designing and implementing large systems that are scalable and highly available.

The challenges designing and building large systems are in how they are decomposed and communicate with each other. You will learn how to define boundaries based on business capabilities and implement asynchronous messaging for communication.

This course will show architectural patterns and styles that create a system that is resilient when failures occur. And when load and traffic increases are scalable horizontally on-demand as required.

I've developed this course based on my over two decades of experience designing and developing business systems in distribution, transportation, manufacturing, and accounting.

@jwilger
jwilger / 1 - PII Encryption with Elixir, Commanded, Vault.md
Last active August 12, 2023 03:06
Quick Code Sample on Encrypting PII with Commanded for GDPR/CCPA Compliance

This code is extracted from one of my private projects as an example of how to implement encryption of PII in event streams using two keys: a master key for each "data subject" that is stored in Vault and never transported to the systems that process the PII, and a key unique to each event that is stored (itself encrypted) with the event.

To be clear, the key that is stored with the data is encrypted by another key that is not stored with the data. The idea is that each "data subject" has an encryption key that is stored in Vault (external). When you encrypt data, the library will:

  1. create a new AES 256 encryption key
@xeoncross
xeoncross / Dockerfile1
Last active April 9, 2024 05:20
Examples of using multi-stage builds with docker and Go to reduce the final image size / attack surface.
# Sample from @citizen428 https://dev.to/citizen428/comment/6cmh
FROM golang:alpine as build
RUN apk add --no-cache ca-certificates
WORKDIR /build
ADD . .
RUN CGO_ENABLED=0 GOOS=linux \
go build -ldflags '-extldflags "-static"' -o app
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt \
@aweary
aweary / App.js
Last active August 29, 2021 14:06
import React from "react";
import useMutableReducer from "./useMutableReducer";
const reducer = (draft, action, state) => {
switch (action) {
case "increment":
draft.count++;
break;
case "decrement":
draft.count--;
@swyxio
swyxio / react-router-state-manager.jsx
Last active July 26, 2022 10:43
Sync your state to your query params for copy-pastable state-in-URLs. React Router, Gatsby, and Svelte versions
// note - this was my rough working prototype, but still left some artifacts in the query params.
// todo: also need to debounce the history pushes
// see comments for production Gatsby and Svelte versions which delete nondefault keys in the query params
import React from 'react'
import queryString from "query-string"
export const connectRouterState = defaultURLState => Component => props => {
const { history, location } = props
// note: do not nest objects in URL state
@adymitruk
adymitruk / eventstore.cs
Last active January 6, 2021 02:39
simple event store in #0tech c#
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Text;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
using System.Linq;
using domain;
@tabirkeland
tabirkeland / environment.interface.ts
Last active July 26, 2019 04:33
Ionic 3.9.2 Environment Variables
export interface Environment {
DEBUG : boolean;
API_URL : string;
WS_URL : string;
BASE_URL : string;
}
@rafaelmotta
rafaelmotta / scalling.js
Last active February 12, 2018 12:17
React Native Scale
import {
Dimensions,
} from 'react-native';
const dimensions = Dimensions.get('window');
const { width, height } = dimensions;
const guidelineBaseWidth = 350;
const guidelineBaseHeight = 680;
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]