Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / vite-testing-config.md
Last active April 24, 2024 23:23
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@roger-dev-br
roger-dev-br / swagger.md
Last active April 24, 2024 23:19
Configuração de documentação automática de APIs com o Swagger

Configuração do Swagger no NodeJS

1. Instalar os pacotes

    yarn add swagger-autogen
    yarn add swagger-ui-express

2. Criar o config em config/swagger.js

-- black frames not included
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Camera = Workspace.CurrentCamera
local Module = {}
Module.Position = UDim2.new(0, 0, 0, 0)
@GLMeece
GLMeece / unicode_for_kbd_symbols.md
Created December 7, 2022 21:07
Unicode for Keyboard Symbols

Unicode for Keyboard Symbols

  • ⎋ (escape): U+238B
  • ⇥ (tab): U+21E5
  • ⇪ (caps lock): U+21EA
  • ⇧ (shift): U+21E7
  • ⌃ (control): U+2303
  • ⌥ (option): U+2325
  •  (Apple): U+F8FF (in some Apple-provided fonts only)
  • ⌘ (command): U+2318
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 24, 2024 23:04
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;
@endrsmar
endrsmar / index.ts
Created January 9, 2024 12:11
Raydium new pool listener
import { LiquidityPoolKeysV4, MARKET_STATE_LAYOUT_V3, Market, TOKEN_PROGRAM_ID } from "@raydium-io/raydium-sdk";
import { Connection, Logs, ParsedInnerInstruction, ParsedInstruction, ParsedTransactionWithMeta, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js";
const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com';
const RAYDIUM_POOL_V4_PROGRAM_ID = '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8';
const SERUM_OPENBOOK_PROGRAM_ID = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX';
const SOL_MINT = 'So11111111111111111111111111111111111111112';
const SOL_DECIMALS = 9;
const connection = new Connection(RPC_ENDPOINT);

.NET Workload Troubleshooting

To install the maui workload, you have two options:

  1. dotnet workload install commands
  2. Visual Studio on Windows can install .msi files for each workload pack. Note that the concept of a "Visual Studio workload" is different than a ".NET workload".

VS for Mac's installer and updater use dotnet workload install commands. It's considerably simpler to get a Mac machine to a clean state.

Mac

@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@CrankyBunny
CrankyBunny / startup.gd
Created March 3, 2023 06:03
Determine the instance number for Godot run multiple instances feature
var _instance_num := -1
var _instance_socket: TCPServer
func _init() -> void:
if OS.is_debug_build():
_instance_socket = TCPServer.new()
for n in range(0,4):
if _instance_socket.listen(5000 + n) == OK:
_instance_num = n
break
@ultrafunkamsterdam
ultrafunkamsterdam / fastapi_react.py
Last active April 24, 2024 22:47
FastAPI support for React ( with working react-router )
"""
███████╗ █████╗ ███████╗████████╗ █████╗ ██████╗ ██╗
██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║
█████╗ ███████║███████╗ ██║ ███████║██████╔╝██║
██╔══╝ ██╔══██║╚════██║ ██║ ██╔══██║██╔═══╝ ██║
██║ ██║ ██║███████║ ██║ ██║ ██║██║ ██║
╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
██████╗ ███████╗ █████╗ ██████╗████████╗
██╔══██╗ ██╔════╝ ██╔══██╗ ██╔════╝╚══██╔══╝
██████╔╝ █████╗ ███████║ ██║ ██║