Skip to content

Instantly share code, notes, and snippets.

View jasonleow's full-sized avatar

Jason Leow jasonleow

View GitHub Profile
@jasonleow
jasonleow / index.html
Created July 4, 2024 07:42
jasonleow.com project portfolio site - Vue, Tailwind
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.7.8/vue.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
<?
# 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:0fa007ba1af6913bb2dd20ef8d006bf8
Last active December 27, 2023 04:31
Lists Kit beta - readme

Hey guys, thanks for offering to beta test Lists Kit for me!

Once you get access to this repo, please feel free to fork it, start customizing it for your own needs and deploy.

Where to start to customize your directory site

  • Edit the meta tags to change your website title, description, og images and favicon
  • the default brand color of the template is #FE6A34. ctrl/cmd-f and find instances of FE6A34 in the CSS to change to your brand color
  • for the CTA buttons with animated gradient backgrounds, ctrl-f background: linear-gradient(-45deg, #833ab4, #fd1d1d, #fcb045); to edit
  • to change the hero background image, ctrl-f HERO SECTION to find the .hero-image class, change the url
  • the default font color is #2d3748. ctrl/cmd-f and find instances of 2d3748 in the CSS to change to your preferred font color
@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 / helpers.js
Created January 13, 2021 05:23
node_modules/date-streaks/dist/helpers.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDatesParameter = exports.sortDates = exports.filterInvalidDates = exports.relativeDates = undefined;
var _start_of_day = require('date-fns/start_of_day');
var _start_of_day2 = _interopRequireDefault(_start_of_day);
@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))
@jasonleow
jasonleow / topnav.js
Created October 15, 2020 02:59
Top navbar
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
@import url("https://fonts.googleapis.com/css?family=Assistant:400,400i,700");
body {
margin: 0;
font-family: 'Assistant', sans-serif;
background-color: ;