Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kitze's full-sized avatar
🚀
Solving problems

Kitze kitze

🚀
Solving problems
View GitHub Profile
@kitze
kitze / lemon.page.ts
Last active March 21, 2024 07:59
lemon squeezy helpers
import { NextApiRequest, NextApiResponse } from "next";
import { validateLemonSqueezyHook } from "@/pages/api/lemon/validateLemonSqueezyHook";
import getRawBody from "raw-body";
import { LemonEventType, ResBody } from "@/pages/api/lemon/types";
import { onOrderCreated } from "@/pages/api/lemon/hooks/onOrderCreated";
import { returnError, returnOkay } from "@/pages/api/lemon/utils";
export const config = {
api: {
bodyParser: false,
@kitze
kitze / trim.py
Created April 6, 2023 14:14
trim blank space around images in a folder
from PIL import Image
import os
input_folder = "./public/old"
output_folder = "./public"
if not os.path.exists(output_folder):
os.makedirs(output_folder)
for filename in os.listdir(input_folder):
@kitze
kitze / rename-next-pages-prefix.js
Created December 8, 2022 10:29
if you want to switch to .page syntax for next.js, this script renames all the files in the /pages folder recursively to append .page before the file extension
const fs = require('fs');
const path = require('path');
// Function to rename files in the given directory
const renameFiles = (dir) => {
// Read the contents of the directory
fs.readdir(dir, (err, files) => {
if (err) {
// If there is an error, log it and return
console.error(err);
@kitze
kitze / codafix.css
Created October 5, 2022 19:04
Coda fix css
.kr-column-group {
width: 100vw !important;
}
[data-coda-ui-id="dialog"] > div {
max-width: 1600px;
width: 90%;
}
@media (max-height: 900px) {
@kitze
kitze / codafix.js
Created October 5, 2022 19:03
coda fix js
(function() {
'use strict';
function onDocReady(fn) {
// see if DOM is already available
if (document.readyState === "complete" || document.readyState === "interactive") {
// call on next available tick
setTimeout(fn, 3000);
} else {
document.addEventListener("DOMContentLoaded", fn);
@kitze
kitze / coda-favicon.js
Created June 2, 2022 11:10
A TamperMonkey script that will set the favicon of the page to the page icon of coda
// ==UserScript==
// @name Change coda favicon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Kitze
// @match https://coda.io/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@kitze
kitze / not-wordle.tsx
Created February 1, 2022 19:34
rectangles
const Rectangles = ({
cols,
defaultBackground,
defaultBackgroundEmoji,
paints,
rows,
paint
}) => {
return (
<L.Vertical>
{
"oneOf": [
{
"type": "object",
"description": "Success response",
"properties": {
"success": {
"type": "boolean"
},
"response": {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type Schema =
| {
success?: boolean;
@kitze
kitze / paddle.ts
Created April 16, 2021 17:39
paddle thingie
//methods
import { BaseSchemaThingie, RawPaddleEvent } from "app/core/paddle/types";
import { filterWebookEvents } from "app/core/paddle/utils/filter-webook-events";
import axios, { AxiosResponse } from "axios";
import { GetPayments } from "./types/getPayments";
import { Schema as GetSubscriptionDetails } from "app/core/paddle/sdk/requests/getSubscriptionDetails/type";
import { GetWebhookEvents, PaddleClientConfig, PaddleRequest } from "./types/types";