Skip to content

Instantly share code, notes, and snippets.

View levelsio's full-sized avatar

levelsio levelsio

View GitHub Profile
levelsio / gist:eaf1eb8fb27a5128e916a36d1455f849
Last active March 1, 2024 17:12
If you paste this in Pastebin it gets flagged as "offensive content"!
photoai row dump
"epoch_queued": 1706472613,
"epoch_started": 1706472615,
"status": "finished",
"epoch_started_on_api": null,
"epoch_finished_on_api": 1706473009,
"epoch_failed_on_api": null,
"epoch_failed": null,
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active May 28, 2024 17:40
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
levelsio / upgradeSubPrice.php
Created October 8, 2023 17:28
This script upgrades the price on active subscriptions on Stripe
// set price
foreach($users as $user) {
if(!$user['stripe_customer_id']) {
echo "No Stripe customer id, maybe update in db?";
levelsio / git_graph.php
Last active June 5, 2023 03:49
GitHub style graph in PHP + CSS
.git-graph {
text-align: left;
line-height: 1;
.git-graph-row {
clear: both;
text-align: left;
.git-graph-cell {
// File: twitterFollowerCuratorBot.php
// Created: May 2021
// License: MIT
# MIT license, do whatever you want with it
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
// Modified from @mutsuda's
// by @levelsio
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = ""
// 4) Install Scriptable @
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
echo "\n\n";
echo number_format(count($followers)).' followers';
echo "\n\n";
echo "\n\n";
levelsio / getRandomFollower.php
Created January 11, 2020 10:22
get random Twitter follower from your exported followers.js
// str_replace removes the JS part and makes it into a normal JSON file
$followers=json_decode(str_replace('window.YTD.follower.part0 = ','',file_get_contents(__DIR__.'/followers.js')),true);
echo "\n\n";
echo number_format(count($followers)).' followers';
echo "\n\n";
levelsio / log_js_errors.js
Created December 15, 2019 15:56
Log JS errors as a POST to your server
// <log errors to server>
window.onerror = function (messageOrEvent, source, lineno, colno, error) {
try {
//error message(string).Available as event (sic!) in HTML onerror = "" handler.
messageOrEvent: messageOrEvent,
//URL of the script where the error was raised(string)
source: source,
//Line number where error was raised(number)