Skip to content

Instantly share code, notes, and snippets.

@braden-w
braden-w / description.md
Last active May 8, 2024 00:09
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.
@esskayesss
esskayesss / hathitrust-downloader.sh
Created May 8, 2024 00:06
downloads full view books from hathitrust.org
#!/bin/bash
# utility functions
function rand_str() {
local length=${1:-8}
LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c $length
}
function debug() {
@aroslov
aroslov / handleCorsForCloudFront.js
Created May 21, 2019 07:04
Handle CORS (OPTIONS request) in Edge Lambda for AWS CloudFront
function checkOrigin(origin) {
if (!origin) {
return false;
}
const [protocol, host, port] = origin.split(':');
// TODO: put your own logic here
if (!host) {
return false;
}
if (host === '//localhost') {
@chranderson
chranderson / nvmCommands.js
Last active May 8, 2024 00:04
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@0xdevalias
0xdevalias / bypassing-cloudflare-akamai-etc.md
Last active May 8, 2024 00:04
Some notes/resources for bypassing anti-bot/scraping features on Cloudflare, Akamai, etc.
@darconeous
darconeous / tesla-key-card-protocol.md
Last active May 7, 2024 23:59
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum darco@deepdarc.com.

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

@krisek
krisek / alert.rules.yml
Last active May 7, 2024 23:53
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@Vogtinator
Vogtinator / README.md
Last active May 7, 2024 23:48
Run Win11 on ARM in QEMU

When following this guide on a host not capable of native arm64 KVM, replace -M virt -cpu host -accel kvm with -M virt,virtualization=on -cpu max.

The reason for virtualization=on is that the Windows bootloader does an smc #0 PSCI call, but without EL2, QEMU's TCG does not handle those because PSCI is in HVC mode and such that instruction is treated as undefined. With KVM enabled, smc #0 is handled properly.

Workaround in QEMU for using TCG without virtualization=on:

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b871350856..de11ff51d1 100644
--- a/hw/arm/virt.c