Skip to content

Instantly share code, notes, and snippets.

@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
@paulwongx
paulwongx / git-commands.md
Last active December 1, 2023 18:45
Git Commands

Git Commands

# Checking out a new branch
git checkout -b <branch-name>
git checkout -b feature/my-feature

# Commiting a branch
git add .
git commit -m "Your commit message here"
git push origin <branch-name>
@paulwongx
paulwongx / dashboard_sidebar.html
Created September 1, 2023 20:48
Tailwind Gists
<div class="flex h-screen w-full flex-col bg-green-50">
<div class="h-[72px] w-full bg-green-100">Header</div>
<div id="body" class="flex flex-row">
<div id="sidebar" class="flex-0 scrollbar h-[calc(100vh-72px)] w-64 bg-green-200 flex flex-col">
<div id="top-sidebar" class="flex flex-col bg-red-50">
<div>Menu 1</div>
<div>Menu 2</div>
<div>Menu 3</div>
</div>
@paulwongx
paulwongx / s3_bucket_policy.json
Last active June 23, 2023 21:08
s3 Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetObjectAcl",
"s3:GetObject",
"s3:DeleteObject",
@paulwongx
paulwongx / turborepo.md
Last active June 5, 2023 22:46
Standard Operating Procedures

Turborepo

Creating a new app with tailwindcss

  1. cd apps
  2. npx create-next-app@latest
  3. Add globals.css inside apps
  4. Change .eslintrc.json to .eslintrc.js
module.exports = {
  root: true,
@paulwongx
paulwongx / postgres_commands.md
Last active April 23, 2023 22:49
SQL Command Cheatsheet - PostgreSQL
@paulwongx
paulwongx / announcements.tsx
Created March 28, 2023 00:18
dnd-kit Announcements with chalk
// This file adds coloring to the announcements to make it easier to read and understand what's going on
import {
DragCancelEvent,
DragEndEvent,
DragMoveEvent,
DragOverEvent,
DragStartEvent,
useDndMonitor,
} from "@dnd-kit/core";
@paulwongx
paulwongx / Useful CLI Commands
Created February 28, 2023 01:55
CLI Commands
# Creating a next app from example template
# All examples: https://github.com/vercel/next.js/tree/canary/examples
yarn create next-app -e app-dir-mdx .
@paulwongx
paulwongx / theme-provider.tsx
Created February 26, 2023 18:57
React Theme Provider
"use client"
import React, { useState, SetStateAction, Dispatch } from "react";
import { Color, colors } from "@/types"
import { useIsomorphicLayoutEffect } from "usehooks-ts";
interface ThemeContextProps {
theme: Color;
setTheme: Dispatch<SetStateAction<Color>> | null;
}