Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
@chand1012
chand1012 / notion_blocks_to_md.js
Created February 22, 2025 02:35
Notion Block output from N8N Notion Node to Markdown.
/* Helper function to extract plain text from a rich_text array */
function parseRichText(richTextArray) {
if (!richTextArray || !Array.isArray(richTextArray)) return "";
return richTextArray.map(rt => rt.plain_text).join("");
}
/* Recursively convert a list of notion blocks into a Markdown string */
function convertNotionBlocksToMarkdown(blocks, indentLevel = 0) {
const indent = " ".repeat(indentLevel); // two spaces per indent level
let md = "";
@chand1012
chand1012 / Notion_Page_To_Markdown.json
Created February 22, 2025 02:40
Notion Workflow to Convert a page content to Markdown.
{
"name": "Get Notion Page as Markdown",
"nodes": [
{
"parameters": {
"workflowInputs": {
"values": [
{
"name": "id"
}
@chand1012
chand1012 / obs-timestamper.lua
Last active February 28, 2025 05:41
Mark timestamps to a CSV file with OBS on a hotkey. Use the Python file to process that CSV and recording into clips. https://chand1012.mit-license.org
-- OBS Timestamp Marker Script
-- Allows marking timestamps during recording and saves them to a CSV file
-- Set a hotkey to mark moments in your recording that you can review later
obs = obslua
local marks = {}
local recording_start_time = 0
local settings_hotkey = ""
local settings_directory = ""
@chand1012
chand1012 / checkout.ts
Created April 26, 2025 15:59
Example stripe checkout code for Supabase.
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
import Stripe from "npm:stripe";
import { createClient } from "jsr:@supabase/supabase-js@2";
import headers from "../_shared/headers.ts";
import type { Database } from "../_shared/database.types.ts";
type CheckoutRequest = {
price?: string;
};