Skip to content

Instantly share code, notes, and snippets.

View levelsio's full-sized avatar

levelsio levelsio

View GitHub Profile
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active March 13, 2025 01:19
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 MonkeyIslandAmsterdam.com.
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 https://x.com/levelsio 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!
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e
// by @levelsio
// HOW TO
// 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 = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json"
// 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
<?
# 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
#
require_once(__DIR__.'/../vendor/autoload.php');
<?
// this script receives a Stripe dispute / chargeback and:
//
// - immediately refunds the payment
// - closes the user's account (in my DB, add your own code there)
//
// this is to automate dispute handling (because you never win a dispute on Stripe anyway)
// and by refunding avoiding the chargeback fee
//
@levelsio
levelsio / gist:cd46c0d3bbc1f5a06be715219fe9f74c
Created March 2, 2025 14:50
fly.pieter.com alien mothership UFO hack :D
if (!window.modLoaded) {
window.modLoaded = true;
// Alien mothership creation and management
const mothershipScale = 250; // Massive scale
let mothership;
let mothershipSound;
let mothershipOscillator;
let mothershipGain;
@levelsio
levelsio / upgradeSubPrice.php
Created October 8, 2023 17:28
This script upgrades the price on active subscriptions on Stripe
<?
// set price
$newPricePlanId='price_1NsRt5Inbsdfsfddsf';
$newPriceMonthly=39;
$i=1;
foreach($users as $user) {
if(!$user['stripe_customer_id']) {
echo "No Stripe customer id, maybe update in db?";
<link href="https://fonts.googleapis.com/css?family=Rubik:500" rel="stylesheet">
<script>
$(function() {
$('.nomadcard').bind('mousemove',function(e) {
console.log('mousemove');
pOffset = $(this).offset();
x = e.pageX - pOffset.left;
y = e.pageY - pOffset.top;
w=$(this).width();
@levelsio
levelsio / btc-eth-dca-buy.php
Last active January 21, 2025 12:12
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
#
# Building an MVP?
# Need a quick database you can set up in seconds?
# What about JSON?
#
# by @levelsio (with help from @marckohlbrugge, @oskarth, @maxdeviant and @kumailht)
# JS
db=[]
fs=require('fs')
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//