Skip to content

Instantly share code, notes, and snippets.

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

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?
View wip.md

放送で紹介する用。書きかけです。

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

https://t.co/FIBmVrR83U

生放送の流れを円滑にするために資料を公開しましたが、この記事は未完成で、あとでさらに整理して別途記事にまとめるつもりです


@ort163
ort163 / zt_VPN.md
Last active Jul 7, 2022
Route all traffic with a raspberry pi like a VPN
View zt_VPN.md
View Microphone mute hotkey on macOS.md
  1. Open Automator.app
  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
drpventura / Student.cpp
Last active Jul 7, 2022
Student class moved to separate .h and .cpp files. See video at https://youtu.be/gyA7uDlazkc.
View Student.cpp
#include "Student.h"
using namespace std;
Student::Student(string theName, double theGpa) : name(theName), gpa(-1) {
set_gpa(theGpa);
}
// accessor
@mattiaz9
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
}
View aws-batch-fsxlustre.md

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
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
firebase.initializeApp(firebaseConfig);
@philippelatulippe
philippelatulippe / terraform-ecs-asg-error.md
Created Sep 22, 2016
Terraform AWS: Unsupported service namespace, resource type or scalable dimension
View terraform-ecs-asg-error.md

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/${aws_ecs_cluster.MY_CLUSTER.name}/${aws_ecs_service.MY_SERVICE.name}"
@michael-milette
michael-milette / moodle-backup.sh
Last active Jul 7, 2022
Backup Moodle database, moodle files and moodledata files
View moodle-backup.sh
# Moodle Site Backup version 1.1
# Copyright 2005-2020 TNG Consulting Inc (www.tngconsulting.ca)
# 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.
# -------------------------------------------------------------------------------------
TIMEZONE="America/Toronto"