Skip to content

Instantly share code, notes, and snippets.

View braden-w's full-sized avatar

Braden Wong braden-w

View GitHub Profile
@braden-w
braden-w / testDeno.ts
Created January 13, 2021 20:01
Implement fetch() in Deno. Taken from Deno Docs, Getting Started.
/*
Run the following in command line:
deno run --allow-net testDeno.ts https://www.wikipedia.org/
From: https://deno.land/manual@v1.6.3/getting_started/first_steps
*/
const url = Deno.args[0]
const res = await fetch(url)
const body = new Uint8Array(await res.arrayBuffer())
@braden-w
braden-w / timers.ts
Created May 18, 2021 04:02
A method of storing and clearing timers
const timeout = {}
const updateUserProfileInformation = (updateKey, updateValue) => {
if (signedIn.value) {
clearTimeout(timeout?.[updateKey])
console.log("timeout :>> ", timeout)
console.log("payload :>> ", updateKey, updateValue)
timeout[updateKey] = setTimeout(async () => {
await updateToFirestore($fire, userProfileInformation, {
[updateKey]: updateValue,
})
@braden-w
braden-w / Todoist Project Indent.ipynb
Last active May 28, 2022 17:07
A Python Notebook that uses the Todoist REST API (v1) and Sync API (v8) to nest all projects with an emoji as the project name underneath a project (to be used like a folder).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@braden-w
braden-w / darkmode.css
Last active June 10, 2022 02:44
My Personal Dark Theme CSS File for Ferdi Google Calendar.
html {
-webkit-filter:invert(85%) hue-rotate(180deg)!important;
filter:invert(85%) hue-rotate(180deg)!important;
background:#181a1b!important;
}
.CflnFb {
background-color:#7b96c1!important;
filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important;
color:#FFF!important;
@braden-w
braden-w / DaisyUI Clear Input.svelte
Last active July 3, 2022 12:11
DaisyUI Clear Input Button. Demonstrates how to add a "clear input" button to DaisyUI, with an example in Svelte. Feel free to style and modify as desired.
<label class="label" for="my-id">
<span class="label-text">Insert your label here...</span>
</label>
<div class="input-group">
<input
tabindex="0"
type="text"
id="my-id"
class="input input-accent border-opacity-20"
@braden-w
braden-w / obsidian-web-clipper.js
Last active November 29, 2022 15:45 — forked from Asseel-Naji/obsidian-web-clipper.js
Prompt_Obsidian Bookmarklet to clip pages
javascript: (function () {
/* Optional vault name */
// const vault = prompt("Vault name (leave blank for default):", "");
const vault = ""
const vaultName = vault ? "&vault=" + encodeURIComponent(`${vault}`) : ""
/* Get Title */
const title = document.title
function processTitle(fileName) {
fileName = fileName.replace(": ", " - ").replace(/[/\\?%*|"<>]/g, "-")
@braden-w
braden-w / 2022-11-29 obsidian-web-clipper.js
Last active November 30, 2022 05:00
My current iteration of Obsidian Web Clipper
javascript: (function () {
/* Optional vault name */
// const vault = prompt("Vault name (leave blank for default):", "");
const vault = ""
const vaultName = vault ? "&vault=" + encodeURIComponent(`${vault}`) : ""
// Initialize variables
const URLtoFolder = {
"https://www.reddit.com": "Reddit",
"https://www.youtube.com/short": "Short",
@braden-w
braden-w / description.md
Last active July 1, 2024 16:41
Google Sheets Script for Fetching Data from Supabase

Google Sheets Script for Fetching Data from Supabase

This Google Sheets script fetches data from a Supabase database and writes the selected headers and data to the active sheet. The script first clears the sheet, writes the headers, then fetches the data from the Supabase API, and finally writes the data to the sheet. It is optimized and has anonymized variables for public use.

How to Use

  1. Create a new Google Sheet or open an existing one.
  2. Click on "Extensions" in the menu, then select "Apps Script." (If you don't see "Extensions," click on "Tools" and then "Script editor.")
  3. In the Apps Script editor, replace the default Code.gs content with the content of supabase_to_google_sheets.gs.
  4. Replace the SUPABASE_URL and SUPABASE_ANON_KEY variables with your actual Supabase URL and anon key.
@braden-w
braden-w / tasks.md
Last active October 19, 2023 19:44
Tasks for EcoPackables

Introduction

Your Job is to Provide UI Mockups of the EcoPackables Enterprise Dashboard, inspired by the design system of ShadCN UI and the provided Figma designs and existing routes.

Step 1: Understanding the Dashboard Routes

  • Familiarize yourself with the provided Figma designs. Here are the routes in question:
    • Home - which will correspond to /enterprise/dashboard
    • Clients - which will correspond to /enterprise/dashboard/clients
  • Messages - which will correspond to /enterprise/dashboard/messages