This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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, | |
}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// 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?"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); | |
async function handleRequest(request) { | |
let url = new URL(request.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta property="og:image" content="https://imgen.jitbit.com/?txt={{ title }}&logo={{ url }}" /> | |
<meta name="twitter:image" content="https://imgen.jitbit.com/?txt={{ title }}&logo={{ url }}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Embed Test Site</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style type="text/css"> | |
.container { | |
margin: 4rem auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
has_many :sessions, -> {order "created_at DESC"} | |
def streak | |
streak_count = 0 | |
today = Time.now.to_date | |
dates_array = self.sessions.map do | session | | |
session.created_at.to_date |
NewerOlder