Skip to content

Instantly share code, notes, and snippets.

@atrakic
atrakic / XUnitAsserts.cs
Created April 24, 2024 07:35 — forked from jonesandy/XUnitAsserts.cs
A cheat sheet of Asserts for xUnit.net in C#
/*
STRINGS
*/
Assert.Equal(expectedString, actualString);
Assert.StartsWith(expectedString, stringToCheck);
Assert.EndsWith(expectedString, stringToCheck);
// Some can also take optional params
Assert.Equal(expectedString, actualString, ignoreCase: true);
Assert.StartsWith(expectedString, stringToCheck, StringComparison.OrdinalIgnoreCase);
@atrakic
atrakic / README.md
Created April 16, 2024 04:57 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

  • Data Structures and Algorithms Made Easy
  • The Art of Statistics
  • Designing Machine Learning Systems
  • Software Architecture: The Hard Parts
  • Grokking Algorithms
  • Refactoring: Improving the Design of Existing Code
  • The Pragmatic Programmer
  • Clean Architecture
@atrakic
atrakic / README.md
Created February 14, 2024 11:45 — forked from straker/README.md
Basic Pong HTML and JavaScript Game

Basic Pong HTML and JavaScript Game

This is a basic implementation of the Atari Pong game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When a ball goes past a paddle, the other player should score a point. Use context.fillText() to display the score to the screen
@atrakic
atrakic / markov.py
Created February 14, 2024 11:32 — forked from benhoyt/markov.py
Generate text from an input using a simple Markov chain generator
import collections, random, sys, textwrap
# Build possibles table indexed by pair of prefix words (w1, w2)
w1 = w2 = ''
possibles = collections.defaultdict(list)
for line in sys.stdin:
for word in line.split():
possibles[w1, w2].append(word)
w1, w2 = w2, word
@atrakic
atrakic / Dockerfile
Created February 14, 2024 11:32 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
spring1843/go-dsa
diagrid-labs/dapr-workflow-demos
awslabs/specctl
roib20/terraform-provision-gke-cloudflare
Cloud-Native-Security/gitops-the-magickey
BuoyantIO/gitops-linkerd
techiescamp/kubernetes-learning-path
sabbour/aks-app-template
databricks/terraform-databricks-examples
Azure/mlops-project-template
terraform {
required_version = ">= 0.12.6"
}
variable "environment" {
type = string
description = "What deployment environment should we use <dev|stg|prd>?"
default = "dev"
}
@atrakic
atrakic / README.md
Created August 3, 2021 14:09 — forked from twolfson/README.md
Setting up SOPS

I'm learning about SOPS and setting it up as my preferred mechanism for storing secrets. Here are my notes.

PGP

It’s security mechanism is that we (i.e. client) use a PUBLIC key from the receiver (i.e. server) and encode it with a random key (I’m saying nonce but it could be reused)

This varies from RSA and SSH because the server uses a PUBLIC key to identify the client.

Web of trust

Web of trust operates by still using PGP (i.e. encoding with recipient’s public key) but additionally, we can encrypt/sign the data as our own by signing it with the client’s private key.

This means the recipient will initially decrypt via our (i.e. client’s) public key (verifying the source) and then decrypting via their (i.e. server’s) private key to get the data.

@atrakic
atrakic / clean_code.md
Created May 28, 2021 07:45 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules