Skip to content

Instantly share code, notes, and snippets.

@BadPirate
BadPirate / FoundationNetworking+AsyncAwait.swift
Last active September 17, 2024 01:11
Linux Compatible URLSession Async (AsyncBytes)
//
// FoundationNetworking+AsyncAwait.swift
//
//
// Created by BadPirate on 7/10/24.
//
/// Currently, Foundation that is used for servers (Like Vapor) has split out URLSession into FoundationNetworking, while it has support for async / await
/// Generally, FoundationNetworking URLSession doesn't support the async/await helpers (like `data()` and `bytes()`) This extension will allow you to
/// Use these as normal if FoundationNetworking is present, by providing an implementation.
@BadPirate
BadPirate / software_dev_job_types.md
Created August 29, 2024 17:13
Software Development Job Types 2024
Name Examples Pay Description
MANGA Microsoft, Apple, Netflix, Google, Amazon 10 Top pay and benefits, user facing products, well known brands
Enterprise Microsoft, Oracle, Salesforce, SAP, IBM 8 Software for buisness, solid pay and benefits
AAA Games Tencent, Ubisoft, EA, Blizzard, Epic 7 Lots of eng wants to be game dev, so there is less demand, AAA Games often have long hours and less benefits
Startup OpenAI, Stripe, Paypal, and others before they got big 5 Smaller company that hasn't proven themselves to the market yet but has seed capital and funding. Normally the benefits and pay are worse and they "make up" for it with stock options that could be worth a lot of money but rarely payout anything
Contract Independent 4 Get on websites like fiv
@BadPirate
BadPirate / scam_fingerprint.json
Created September 7, 2022 21:19
I captured the IP Fingerprint of someone trying to crypto scam me
{
"visitorId": "XVQAhCuHIopQPcx8f5qI",
"requestId": "1662337931051.IdEq99",
"browserDetails": {
"browserName": "Chrome",
"browserMajorVersion": "104",
"browserFullVersion": "104.0.0",
"os": "Windows",
"osVersion": "10",
"device": "Other",
dokku apps:create hasura
dokku domains:add hasura hasura.my.domain.com
dokku postgres:create hasura-db
dokku postgres:link hasura-db hasura
dokku config:set hasura HASURA_GRAPHQL_DATABASE_URL="<info from above command>" HASURA_GRAPHQL_ADMIN_SECRET="blahblah" HASURA_GRAPHQL_ENABLE_CONSOLE="true"
dokku proxy:ports-set hasura http:80:8080
docker pull hasura/graphql-engine
docker tag hasura/graphql-engine dokku/hasura
dokku tags:deploy hasura
dokku letsencrypt hasura
@BadPirate
BadPirate / badpirate.pub
Created August 5, 2020 21:49
Badpirate Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIo0eW1M03SufRuSJhmibnv7tnl71n+GP9H5GJ14QKi3xQWxtpcu89UPydb5+X1jRZWf5VW8Vd8/B7FM239L4UCvztqcXcb4pxyR4FKOWnPnJSWsz+bNwkF4y8HZ1G9sAJe/u3sw/dXmbfJZZbA9fi9wFWS1bkliIDMfOCjP99dgoSOfUFAHexwxgoBjrPTnrEQJaAiIfgdPhH4RdpsfetJHqxrPgculUY1lwECQYAN/aYGqOIWKomFyJtb3wgeuUxfiR1OGTcRLshBcE1+isiiME7IQKcmC2XcbUn9yKPZLBu33uyIse/Aa+nTCWFldfUWRE108AYUo+HSyCHwL/gwHTRBApnhnpcNiEBlPMiadkyadccdvFTxT7j2GbHc8XJkurfxU8AVCXtiYjm7CZyAX51+zw+Oouyb2Py9V3qiqv94Q7k/ejm64DSZ+SzUPIWFKB0eHB4k/TeyXRtnYmbBixHuz3dWoGyTa5g9iy58uieqyim8edJC0fCiR4mlkhaNbbwzFq+s5F4l0nb7gR4D/ltzFTYNzmh/ovC+gEJksaqo9rRT4vF+9LV3/N44QvwK2RCZB7g2s1h5TPOLt0Vz8yMPL1ioOCM/iVLnyNPYQga1/4yP9sJ/Ud/4wftWuPvkBxdOXSSzNeb4sXaq/ARmoEajb0mZ3Ow+XiWXoNF3Q== badpirate-github
@BadPirate
BadPirate / kt_campaign.md
Created August 4, 2020 01:26
Kings Throne Campaign Baselines
Castle Type Hero Maid Prizes
Gilderwood Forest Gold Lvl 54, 30k Attributes 34 Intimacy 64 Charm Tomes lv 1
Gildershire Castle Grain 80 / 40k 50 / 80 Ruby Ascension
Goldshore Soldiers 100 / 49k 70 / 100 Dueling Fragment / Tomes lv 1
Southern Boundary Gold 150 / 80k 90 / 120 Tourney Pass / Alliance Fragment / Expedition Charter
@BadPirate
BadPirate / kt_vip.md
Last active January 10, 2022 04:46
Kings Throne VIP levels
VIP Level Points Required Cummulative Aprox $ Cummulative
1 300 $5
2 1000 $16
3 2560 $42
4 5800 $96
5 10000 $166
6 40000 $666
7 100000 $1666
8 300000 $5000
@BadPirate
BadPirate / kt_castle_rewards.md
Last active July 30, 2020 22:59
King Throne Rewards
Prize Castle Used for
Amulet / Sword / Necklace Gildershire / North Dialann Leveling heroes past certain thresholds, becomes super necessary late game
Tourney / Dueling Token GoldShore / South Dialann Initiating fights in tourney
Expedition South Dialan Super useful for restoring heroes in a variety of contexts
Alliance Tokens Southern Boundary These let you max out your free alliance donation every day with parts that combine into alliance letters
Council Coin / Feast Invites Humbermoor Most overpowered castle, feast invites and council coins provide regular free points in exchanges for other good items
@BadPirate
BadPirate / BotDefenseTools.csv
Last active May 12, 2020 00:17
A non-comprehensive list of tools that can be used for bot defense
Tool DOS Stuffing SPAM Dedicated BotNet User-Friction iOS Android Web Cost
Re-Captcha™ 1 3 3 1 3 1 - 4 + + 0
CloudFlare™ 5 4 2 0 5 0 - 4 N/A N/A N/A 5
AWS Cognito™ 4 4 5 0 3 0 - 4 + + + 0 - 3
Twilio™ 1 5 3 3 3 5 N/A N/A N/A 3 - 5
HumanDetect™ 1 5 5 4 5 0 + Coming Coming Free
@BadPirate
BadPirate / index.js
Created April 13, 2020 01:50
Custom Firebase Hasura Claims with Firestore
const functions = require('firebase-functions')
const admin = require('firebase-admin')
const cors = require('cors')({
origin: (origin, callback) => {
const allowed = ['http://localhost:3000', 'https://yourfinalwebsite.com']
if (allowed.indexOf(origin) !== -1) {
return callback(null, true)
}
return callback(new Error(`CORS Policy denies ${origin}`), false)
},