Skip to content

Instantly share code, notes, and snippets.

View joekiller's full-sized avatar

Joseph Lawson joekiller

View GitHub Profile
joekiller /
Created October 10, 2023 14:58
Migrating macbooks

Some helpful commands:

on the old machine clean out caches and stuff

find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
find . -name '.pytest_cache' -type d -prune -exec rm -rf '{}' +
find . -name 'venv' -type d -prune -exec rm -rf '{}' +
find . -name '*x86_64*' -type d -prune -exec rm -rf '{}' +
find . -name 'cache' -type d -prune -exec rm -rf '{}' +
joekiller /
Last active September 25, 2023 00:44
raspberry pi nas/server
joekiller / strip.js
Last active September 28, 2022 05:40
Strip token secrets in javascript
* Very useful for pumping through logs that you don't want to leak stuff.
* @param {string} [target] string to scrub
* @param {(string | RegExp)[]} tokens to be scrubbed, regex match or exact string match
function scrubString(target, tokens) {
if(!target || !tokens || tokens.length === 0) {
let scrubbed = target;
joekiller /
Last active November 19, 2023 23:07
example notification

Below are two notifications from the websocket. One is a normal listing and the other is a listing.

Also attached is the logic for detecting a "postlife" spell. A postlife spell is an items that was only avaliable after spells were removed from the game however thought gitches it still got a spell.

joekiller /
Last active October 17, 2023 12:25
TF2 Trade History

This is a program to scan though your steam trade history for TF2 Trades. you have to update in scanHistory.json on line 6 the target to match your steam id. so for me it's 76561197966563795 but you need to replace it with your steamID64, look it on on steamrep if you are unsure. and then you need to make a file in the same directory called .env.json that contains an object with your Steam API Key:

Also this requires nodejs 14+. I run the program by running the command: node scanHistory.js.

You can use VSCode or other IDEs like Webstorm that can interpret JSON files to make this easy. It's kinda a cludge but it works. Basically it makes two files for trade history. the files are a date.json and date-details.json like 1321088897.json and 1323108997-details.json image

The way this works is it runs through all your trade history and then looks up all the

joekiller /
Last active June 16, 2023 12:29
Updated craft hat skus
joekiller / BackpackSocketManager.ts
Created April 23, 2022 15:13
import ReconnectingWebSocket from 'reconnecting-websocket';
import WS from 'ws';
import * as Events from 'reconnecting-websocket/events';
export default class BackpackSocketManager {
private ws: ReconnectingWebSocket;
constructor() { = new ReconnectingWebSocket('wss://', [], {
WebSocket: WS,
joekiller / https.ts
Last active April 4, 2022 04:10
Nodejs Typescript Https get and post
import https from "https";
export async function httpsPost<T>(params: { hostname: string, path: string, headers: Record<string, any>, body?: string }): Promise<{ status: number, data: T | string }> {
let {path, hostname, body, headers} = params;
let options = {
port: 443,
method: 'POST',
joekiller / index.d.ts
Created February 21, 2022 04:12
node-pushbullet-api v3.0 typescript types
declare module 'pushbullet' {
import { EventEmitter } from 'events';
import { Response } from 'node-fetch';
interface MakeRequestOptions<T> {
qs?: Record<string, string>
json?: T
export interface MeResponse {
joekiller / get.ts
Created December 7, 2021 23:55
https.get typescript nodejs
const data: string = await new Promise((resolve, reject) => {
https.get(targetUrl, (res) => {
let rawData = '';
res.on('data', (chunk) => {
rawData += chunk;
res.on('end', () => {
try {