Skip to content

Instantly share code, notes, and snippets.

@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 )
"""
███████╗ █████╗ ███████╗████████╗ █████╗ ██████╗ ██╗
██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║
█████╗ ███████║███████╗ ██║ ███████║██████╔╝██║
██╔══╝ ██╔══██║╚════██║ ██║ ██╔══██║██╔═══╝ ██║
██║ ██║ ██║███████║ ██║ ██║ ██║██║ ██║
╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
██████╗ ███████╗ █████╗ ██████╗████████╗
██╔══██╗ ██╔════╝ ██╔══██╗ ██╔════╝╚══██╔══╝
██████╔╝ █████╗ ███████║ ██║ ██║
import vertexai
from vertexai.generative_models import GenerativeModel, ChatSession
vertexai.init(project=project, location=location)
model = GenerativeModel("gemini-1.5-pro-preview-0409")
chat = model.start_chat()
def get_chat_response(chat: ChatSession, prompt: str) -> str:
text_response = []
responses = chat.send_message(prompt, stream=True)
@rouxcaesar
rouxcaesar / bradfield-thoughts.md
Last active April 24, 2024 22:38
Thoughts on Bradfield

My Thoughts on Bradfield

I've been asked by several people over time about my experience with the classes offered by Bradfield, and thought that I should save some future keystrokes by writing up a short gist for future reference. Hopefully this gist will be useful for others who are considering Bradfield and wondering it is worth it. My intended audience is primarily Launch School students who have completed the Core program and likely also Capstone, but the majority of this gist will be applicable to anyone who is a working/experienced software engineer.

Since late 2019, I've taken 4 short courses from the Bradfield School of Computer Science and in 2021 I enrolled in their Computer Science Intensive (CSI) program1. Overall, I've found the courses and CSI to be an excellent opportunity to grown my technical skills and broaden my knowledge of CS topics.

The courses I completed were:

  • Computer Architecture: The Hardware/Software Interface
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active April 24, 2024 22:33
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@diego3g
diego3g / settings.json
Last active April 24, 2024 22:26
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {