Skip to content

Instantly share code, notes, and snippets.

@paulwongx
paulwongx / heater.md
Created November 17, 2024 18:26
Heater Electricity Usage
Heater Power Setting Wattage 3hrs / day 5hrs / day 8hrs / day
Delonghi Dragon Low Power 730 W $10.38 $17.30 $27.68
Med Power 840 W $11.94 $19.91 $31.85
High Power 1550 W $22.04 $36.74 $58.78
Lasko Low Power 815 W $11.59 $19.32 $30.90
Med Power 1280 W $18.20 $30.34 $48.54
High Power 1450 W $20.62 $34.37 $54.98
  • Assuming $0.158/kWh cost
@paulwongx
paulwongx / air_purifier.md
Last active November 17, 2024 05:34
Air purifier electricity usage & noise levels

Air purfier electricity usage & Noise levels

Model Mode Power (W) Noise (dB)
Levoit Core 400S Sleep 3.3W 35dB
Level 1 5.0W 42dB
Level 2 8.0W 49dB
Level 3 15.5W 58dB
Level 4 38.8W 68dB
Coway Airmega 400S Sleep 4.6W 34dB
@paulwongx
paulwongx / seo-tools.md
Created December 3, 2023 17:45
SEO Tools
  • Ahrefs SEO Toolbar
  • Keywords Everywhere
  • Meta SEO Inspector
  • Mozbar
  • NinjaOutreach Lite
  • Redirect Path
  • SEO Minion
  • SEOquake
  • Similarweb
  • Ubersuggest
@paulwongx
paulwongx / js-cheatsheet.md
Created December 1, 2023 19:38
Javascript Cheatsheet

Javascript Cheatsheet

  1. This document focuses on more nuanced topics. It is not comprehensive.
  2. Examples are taken from MDN mostly

Strings

// [@@iterator]() - iterating a string
const str = 'A\uD835\uDC68';
const strIter = str[Symbol.iterator]();
@paulwongx
paulwongx / url_shortener.md
Created December 1, 2023 18:46
System Design Notes

URL SHORTENER

Youtube URL: https://www.youtube.com/watch?v=JQDHz72OA3c

How to design a url shortener

Ask questions to clarify uncertainties

  1. What is the length of the URL which is shortener
  2. What is the volume of the traffic
  3. Should this be a single system or scalable
@paulwongx
paulwongx / index.html
Created November 30, 2023 16:57
Object Detection
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video Camera</title>
<!-- Load TensorFlow.js. This is required to use coco-ssd model. -->
<script defer src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"> </script>
<!-- Load the coco-ssd model. -->
@paulwongx
paulwongx / cql_example.md
Last active November 18, 2023 18:56
CQL Example
-- CQLSH

-- creating keyspace
CREATE KEYSPACE dev_db WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = 'true';

-- consistency
CONSISTENCY; -- Current consistency level is LOCAL_QUORUM.
CONSISTENCY ONE; -- OK for one node
CONSISTENCY QUORUM; -- Best for multiple nodes at high replication factor of ~3
@paulwongx
paulwongx / object-oriented-programing.md
Created October 18, 2023 18:02
Object Oriented Programming (OOP) Notes

Object Oriented Programming

SOLID Principles

  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)
@paulwongx
paulwongx / deploy.yaml
Created September 23, 2023 01:58
Github Actions Workflows
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest