Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 18:08
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@silver-xu
silver-xu / ts-boilerplate.md
Last active April 26, 2024 18:06
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@vasanthk
vasanthk / System Design.md
Last active April 26, 2024 18:05
System Design Cheatsheet

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?
@m5r
m5r / delete-account-form.tsx
Created December 14, 2021 22:05
Remix background jobs using a resource route
import type { ActionFunction } from "remix";
import { Form, redirect, useTransition } from "remix";
import { enqueueDeleteUserData } from "~/app/routes/queues/delete-user-data";
import authenticator from "~/app/auth/authenticator";
import { destroySession, getSession } from "~/utils/session.server";
import db from "~/utils/db.server";
export const action: ActionFunction = async ({ request }) => {
const user = await authenticator.isAuthenticated(request, { failureRedirect: "/auth/sign-in" });
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@desdeinter
desdeinter / formatar_cnpj_cpf.md
Created April 26, 2024 17:59 — forked from marceloneppel/formatar_cnpj_cpf.md
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === 11) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  }