Skip to content

Instantly share code, notes, and snippets.

View jasonleow's full-sized avatar

Jason Leow jasonleow

View GitHub Profile
<?
# 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');
@jasonleow
jasonleow / AdvancedSelect.vue
Created January 29, 2024 12:21 — forked from lhermann/AdvancedSelect.vue
Vue Timezone Picker
<template>
<!-- Select Button -->
<button
ref="referenceRef"
class="flex items-center gap-3 rounded h-10 px-4"
:class="{
'border text-black' : !props.dark,
'border bg-neutral-800 border-neutral-600 text-white' : props.dark,
'opacity-40': disabled,
}"
@jasonleow
jasonleow / gist:68d009d38538b06a914c49bad4327435
Created November 27, 2023 12:12 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
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.
It's much easier than you think and you'll be shocked by how relatively well it works with little work.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@jasonleow
jasonleow / debugger pause beforeunload
Created January 3, 2023 07:41 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@jasonleow
jasonleow / streak.js
Created January 12, 2021 09:03 — forked from tharna/streak.js
Check streak
if(user.lastPost) {
let lastDate = new Date(JSON.parse(user.lastPost))
lastDate.setHours(0, 0, 0)
lastDate.setMilliseconds(0)
lastDate.setMinutes(-(data.offset))
let currentDate = new Date()
currentDate.setDate(postDate.getDate() - 1)
currentDate.setHours(0, 0, 0)
currentDate.setMilliseconds(0)
currentDate.setMinutes(-(data.offset))