Skip to content

Instantly share code, notes, and snippets.

vasanthk / System
Last active Jul 7, 2022
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?


ちょっと伸びたのでさらに追記。これは元々自分の勉強がてら書いていたもので、これを書く過程でどうしても自分の理解では説明できないところがあり koba789 に依頼してペアプロをしてもらった、という流れがあります。その結果が次の動画です。


ort163 /
Last active Jul 7, 2022
Route all traffic with a raspberry pi like a VPN
View Microphone mute hotkey on
  1. Open
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
drpventura / Student.cpp
Last active Jul 7, 2022
Student class moved to separate .h and .cpp files. See video at
View Student.cpp
#include "Student.h"
using namespace std;
Student::Student(string theName, double theGpa) : name(theName), gpa(-1) {
// accessor
mattiaz9 / blurhashDataURL.ts
Last active Jul 7, 2022
Convert blurhash to a base64 DataURL string (no canvas or node-canvas)
View blurhashDataURL.ts
import { decode } from "blurhash"
export function blurHashToDataURL(hash: string | undefined): string | undefined {
if (!hash) return undefined
const pixels = decode(hash, 32, 32)
const dataURL = parsePixels(pixels, 32, 32)
return dataURL

Mount FSx Lustre on AWS Batch

This guide describes how to mount FSx Lustre filesystem. I give an example cloudformation stack to create the AWS Batch resources.

I loosely follow this guide.

For the parameters, it's important that the Subnet, Security Group, FSx ID and Fsx Mount Name follow the guidelines below:

Parameter Description
codediodeio / config.js
Last active Jul 7, 2022
Snippets from the Firestore Data Modeling Course
View config.js
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
// Initialize Firebase
philippelatulippe /
Created Sep 22, 2016
Terraform AWS: Unsupported service namespace, resource type or scalable dimension

If you try to attach an auto-scaling group to an ECS service and you get

Unsupported service namespace, resource type or scalable dimension

Then it's possible you didn't correctly format the resource_id in your aws_appautoscaling_target. It needs to be in the format service/clusterName/serviceName, and terraform will not format it for you. Try:

resource_id = "service/${}/${}"
michael-milette /
Last active Jul 7, 2022
Backup Moodle database, moodle files and moodledata files
# Moodle Site Backup version 1.1
# Copyright 2005-2020 TNG Consulting Inc (
# Author: Michael Milette
# License: GNU GPL 3.0 or later.
# Installation: Place this script in the APPPATH folder.
# Run it as "sudo" or with sufficient permissions.
# -------------------------------------------------------------------------------------
# Configuration section - Assumes Moodle's WEBROOT and DATA are under the APPPATH.
# -------------------------------------------------------------------------------------