Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 18:02
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;
@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);
  } 
 
@Rarst
Rarst / hugo-remote-api.html
Last active April 26, 2024 18:00
Remote API example in Hugo static site build.
{{ with getJSON "https://noti.st/rarst.json" }}
<h3 class="text-left">Latest Talk</h3>
{{ $talks := (index .data 0).relationships.data }}
{{ $latest :=index $talks 0 }}
<a href="{{ $latest.links.self }}">
<img src="{{ $latest.attributes.image.src }}" alt="{{ $latest.attributes.title }}"
class="img-responsive" style="max-height: 210px;border: 1px solid #eee" loading="lazy"/>
</a>
{{ end }}
@marceloneppel
marceloneppel / formatar_cnpj_cpf.md
Created January 6, 2020 12:17 — forked from davidalves1/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);
  } 
 
@cabrerahector
cabrerahector / bitbucket-pipelines.yml
Last active April 26, 2024 17:58
Bitbucket Pipelines - Deploying to Server with atlassian/ftp-deploy
image: atlassian/default-image:2
pipelines:
branches:
master:
- step:
name: Deploy to Production
deployment: production
script:
@JBlond
JBlond / bash-colors.md
Last active April 26, 2024 17:56 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@dotja
dotja / drf-api-swagger-doc.md
Last active April 26, 2024 17:55
Django REST Framework API documentation using Swagger

API Documentation with DRF and Swagger

Overview:

  • We need to create a schema. The schema outlines all the endpoints and actions of our API.

  • We need to create the documentation that is a more human-readable form of the schema.

Steps: