Skip to content

Instantly share code, notes, and snippets.

@BigRoy
BigRoy / openpype_to_ayon_core.md
Last active April 25, 2024 16:42
OpenPype codebase refactor to AYON core

Transition code from OpenPype to Ayon Core

Refactor

  • openpype -> ayon_core
  • Loader plugins update method now takes context instead of representation argument | ynput/ayon-core#130
  • Loader plugins attribute families (list) -> product_types (set) | ynput/ayon-core#191
  • Creator plugins: family -> productType | ynput/ayon-core#113
  • Refactor OpenPypeModule -> AYONAddon | ynput/ayon-core#22
    • now in ayon_core.addon instead of ayon_core.modules
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active April 25, 2024 16:42
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 25, 2024 16:41
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 25, 2024 16:40
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;
@holyjak
holyjak / oidc_client.clj
Last active April 25, 2024 16:39
A stateful CLI tool for getting access token from an OIDC provider
#!/usr/bin/env bb
(ns oidc-client
"Get end-user access token from an OIDC provider, caching the access/refresh token in an encrypted file. Code in https://babashka.org
Usage:
/path/to/oidc_client.clj
When there are no cached, valid tokens, it will open a browser with the OIDC provider login URL and start a HTTPS-enabled
callback server on localhost. Make sure that the resulting redirect_uri is registered with your provider.
@macshome
macshome / IOKit.swift
Last active April 25, 2024 16:39
This playground shows you a few different ways to get device info via IOKit.
// This playground shows you a few different ways to get device info via IOKit.
// If you want to explore IOKit and look for interesting data I would download
// the Additional Developer Tools from Apple and use the IORegistryExplorer app.
// It makes it super easy to poke around in the IOKit planes.
import IOKit
import Foundation
// For convient access we can make a computed getter for the PlatformExpert.
// Traditionally this has been where you go to find all sorts of data about the
@RobinLinus
RobinLinus / sig_pow.md
Last active April 25, 2024 16:36
Timelocked Proof of Work via signature length

The following script allows everyone to spend; the shorter your signature the earlier you can spend.

OP_SIZE
OP_CHECKSEQUENCEVERIFY OP_DROP

OP_CHECKSIGVERIFY

The point R = 1/2 G has the smallest known x coordinate -- x = 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63. If the public key is chosen P = 1 G then the ECDSA signature becomes s=2(H(m)+x). So, the smaller H(m) the smaller s (as long as it is bigger than x ~ 2^165). Thus, the above output is spendable by the miner mining the lowest TX hash.

@shivaalroy
shivaalroy / openai_usage_tool.py
Last active April 25, 2024 16:35
Get OpenAI Usage / Spend information programmatically, broken down by API key, model, input and output
import argparse
from datetime import date, timedelta
from typing import TypedDict
import requests
from tabulate import tabulate
class OpenAiUsageTool:
'''
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@xdavidhu
xdavidhu / wokplace-ssl-pinning-bypass.md
Last active April 25, 2024 16:32
Bypassing SSL Pinning in Facebook/Meta Workplace (Android)

Tested on Workplace for Android version 362.0.0.29.109. This approach might work in other Facebook/Meta applications. Thank you Imre Rad for helping me analyze the binary.

How does it work?

The Workplace Android app uses the Fizz open source TLS-1.3 library to communicate with the backend APIs. This library is written in C++, and is compiled to native code. It is running as a native library attached to the Android app.

The certificate verification is implemented in fizz/client/ClientProtocol.cpp, on line 1944. The easiest way to bypass this check is to patch the if (state.verifier()) { check on line 1942.