Skip to content

Instantly share code, notes, and snippets.

@CaptainStabs
CaptainStabs / converter.py
Created February 6, 2024 02:03
Qb-inventory to qs-inventory. Convert from qb to quasar inventory
import json
import pandas as pd
import csv
# Export from database by running `SELECT citizenid, inventory FROM players;`
# Make sure to export using an app like TablePlus and use the `Quote if needed` option. This will not work if you export from HeidiSQL
# The output should look something like this
'''
citizenid,inventory
AFN86608,"[{""slot"":1,""name"":""weapon_nightstick"",""type"":""weapon"",""info"":{""serie"":""54yiL4at180nbcg"",""quality"":100},""amount"":1}
RegisterNetEvent("919-admin:server:MonetaryAction", function(targetId, action, amount)
local src = source
if AdminPanel.HasPermission(src, "givetakemoney") then
if action == "givecash" then
Compat.PlayerActions.AddMoney(targetId, amount)
print("TARGETID", targetId)
print("name", getCharName(targetId))
local logMessage = string.format("**STAFF MEMBER %s** added £%d to **%s[%d]** (%s)'s **wallet**", GetPlayerName(src), amount, GetPlayerName(targetId), targetId, getCharName(targetId))
@CaptainStabs
CaptainStabs / client_customise_me.lua
Last active September 13, 2023 17:02
cd_dispatch custom 111 command
RegisterNetEvent('cd_dispatch:PillboxBell')
AddEventHandler('cd_dispatch:PillboxBell', function()
QBCore.Functions.Notify('You rang the bell letting NHS know that you are here.', "primary", 7500)
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'ambulance'},
coords = data.coords,
title = 'Somebody rang the bell at Pillbox',
message = 'Somebody rang the bell at Pillbox',
flash = 0,
@CaptainStabs
CaptainStabs / bsw_import.txt
Created April 28, 2023 22:35
bsw import stats
20-2850920.csv
Rows Processed: 117,244, Additions: 109,962, Modifications: 3,147, Had No Effect: 4,135
20-3749695.csv
Rows Processed: 256,321, Additions: 245,773, Modifications: 6,383, Had No Effect: 4,165
26-0194016.csv
Rows Processed: 170,777, Additions: 165,908, Modifications: 4,721, Had No Effect: 148
26-3603862.csv
@CaptainStabs
CaptainStabs / install.bat
Created February 8, 2023 15:07
invokeai_conda_installer.bat
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem from https://gist.github.com/maximlt/531419545b039fa33f8845e5bc92edd6
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem CREATE THE ENV PRIOR TO RUNNING THIS SCRIPT
rem Define here the path to your conda installation
@CaptainStabs
CaptainStabs / combined.csv
Created September 10, 2022 20:12
sale price data for LA and Riverside CA
We can't make this file beautiful and searchable because it's too large.
property_county,sale_datetime,sale_price
LOS ANGELES,2020-02-21 00:00:00,9
LOS ANGELES,2020-03-31 00:00:00,550005
LOS ANGELES,2020-02-28 00:00:00,750007
LOS ANGELES,2020-04-16 00:00:00,949009
LOS ANGELES,2020-12-03 00:00:00,1500015
LOS ANGELES,2020-08-24 00:00:00,2900029
LOS ANGELES,2020-11-17 00:00:00,3213032
LOS ANGELES,2020-04-14 00:00:00,2700027
LOS ANGELES,2020-08-24 00:00:00,331003
@CaptainStabs
CaptainStabs / fields2.txt
Created August 11, 2022 16:28
potential fields
BATHS_#_PERHAPS_SPLIT_INTO_HALF_AND_FULL
BEDROOMS
SQFT
UNITOFMEAS
SQFT_UNFINISHED
SQFT_FINISHED_BASEMENT
SQFT_FINISHED
SQFT_BUILDING_FOOTPRINT
SQFT_BASEMENT
SQFT_ATTIC
@CaptainStabs
CaptainStabs / bruteforce.py
Created December 1, 2021 02:16
bruteforce for epal rooms
import hashlib
import requests
import json
from tqdm import tqdm
url = "https://chatroom.epal.gg/mobile/room/check_room_passwd"
headers = {
'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
@CaptainStabs
CaptainStabs / blacklist.txt
Created August 27, 2021 19:12
Blacklist for Dolthub bounty
twitter.com, linkedin.com, instagram.com, youtube.com, tiktok, pinterest.com, reddit.com, www.wicz.com, www.krtv.com, www.foxnews.com, www.wsbtv.com, www.cnbc.com, www.cbs.com, www.nytimes.com, www.yelp.com, www.sacbee.com, www.ed-data.org, www.high-schools.com, www.publiccharters.org, www.publicschoolreview.com, http://elementaryschools.org, www.greatschools.org, www.thearcofil.org, usnews.com, www.guardianangelstaffing.com, www.wikipedia.com, www.mapquest.com, maps.google, www.countyoffice.org, nces.ed.gov, www.schooldigger.com, www.niche.com, http://patch.com, www.point2homes.com, www.zillow.com, ancestors.familysearch.org, www.timeanddate.com, www.neighborhoodscout.com, www.trulia.com, www.ancestry.com, www.wikitravel.com, www.wikiwand.com, handwiki.org, commons.wikimedia.org, www.wric.com, www.wifr,com, www.paec803.org, www.mcsd11.net, www.wnep.com, wwww.whas11.com, www.whsv.com, www.wymt.com, www.waze.com, www.wwrc.com, www.nola.com, www.southbendtribune.com, www.bdtonline.com, newsadvance.com, www.indy
@CaptainStabs
CaptainStabs / mess.py
Created July 14, 2021 02:42
scraper nightmare
import requests
from bs4 import BeautifulSoup, NavigableString, Tag
from urllib.parse import urlparse
import os
import pandas as pd
import csv
import sys
import doltcli as dolt
from doltpy.cli.write import write_pandas
import json