Skip to content

Instantly share code, notes, and snippets.

🎯
Making an impact

Mark McDonnell Integralist

🎯
Making an impact
Block or report user

Report or block Integralist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Integralist
Integralist / AWS Active-Active Patterns Presentation (link to PDF)
Created Feb 14, 2020
[AWS Active-Active Patterns Presentation (link to PDF)] #aws #pdf #presentation #resilience #multiregion #activeactive #pattern #ha #availability
View AWS Active-Active Patterns Presentation (link to PDF)
@Integralist
Integralist / Golang Struct and Interface Embedding Examples.go
Last active Feb 13, 2020
[Golang Struct and Interface Embedding Examples] #go #golang #struct #embedding #embed
View Golang Struct and Interface Embedding Examples.go
package main
import (
"compress/gzip"
"fmt"
"os"
)
type gzipWriterWrapper struct {
*gzip.Writer // what identifier is this exposed as? see below!
@Integralist
Integralist / nginx rate limiting is weird.md
Created Feb 12, 2020
[nginx rate limiting is weird] #nginx #ratelimit
View nginx rate limiting is weird.md

nginx rate limiting is weird

it takes input in requests per second

but that’s not how it rate limits

instead it divides your limit into tenth of a second chunks

so a rate limit of 10 req/s is actually 1 req / 0.1 s

@Integralist
Integralist / 1. let's start with a simple io.Pipe example.go
Last active Feb 12, 2020
[Golang io.Pipe and io.TeeReader combined] #go #golang #io #pipe #tee #reader #writer
View 1. let's start with a simple io.Pipe example.go
package main
import (
"fmt"
"io"
"io/ioutil"
"sync"
)
func readFrom(pr *io.PipeReader, wg *sync.WaitGroup) {
@Integralist
Integralist / Golang A basic Write and Read Gzip.go
Last active Feb 17, 2020
[Golang Gzip] #golang #go #gzip #proxy
View Golang A basic Write and Read Gzip.go
package main
import (
"bytes"
"compress/gzip"
"io/ioutil"
)
func main() {
data := []byte("HelloWorld")
@Integralist
Integralist / Python Boto3 S3 Example.py
Created Feb 5, 2020
[Python Boto3 S3 Example] #python3 #boto3 #aws #s3
View Python Boto3 S3 Example.py
import boto3
aws_access_key_id = "123"
aws_secret_access_key = "456"
session = boto3.session.Session(
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
)
@Integralist
Integralist / 0001-ADR-Example.md
Last active Feb 5, 2020
[ADR Architecture Decision Record] #architecture #decision #record #adr
View 0001-ADR-Example.md

1. Title

Date: YYYY-MM-DD

Status

Accepted|Deprecated|Proposed|Superseded

A decision may be "proposed" if the project stakeholders haven't agreed with it yet, or "accepted" once it is agreed. If a later ADR changes or reverses a decision, it may be marked as "deprecated" or "superseded" with a reference to its replacement.

@Integralist
Integralist / File Permissions with Octal Notation Explanation.md
Created Feb 5, 2020
[File Permissions with Octal Notation Explanation] #file #permissions #octal
View File Permissions with Octal Notation Explanation.md

A file can be accessed by different user types:

  • Owner
  • Group
  • Other

Any one of these groups might be allowed to:

  • Read (r)
  • Write (w)
@Integralist
Integralist / Markdown syntax for links in bottom of document.md
Last active Feb 4, 2020
[Markdown syntax for links in bottom of document] #markdown #links #reference
View Markdown syntax for links in bottom of document.md
@Integralist
Integralist / Python AtomicCounter.py
Last active Jan 31, 2020
[Python Atomic Counter] #python3 #concurrency #threadsafe #lock #atomic #counter
View Python AtomicCounter.py
import threading
class AtomicCounter(object):
"""An atomic, thread-safe counter"""
def __init__(self, initial=0):
"""Initialize a new atomic counter to given initial value"""
self._value = initial
self._lock = threading.Lock()
You can’t perform that action at this time.