This file contains hidden or 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
/** | |
* Fixes a single Supabase query response by replacing a specific field with a given type. | |
* Useful for overriding false-negative errors in Supabase response types for computed relationships. | |
* | |
* @see https://github.com/supabase/supabase-js/issues/1364 | |
* @template T - the original type to modify, or null | |
* @template K - key of the field to replace in T | |
* @template R - type to replace the field with | |
* | |
* @example |
This file contains hidden or 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 your base URL and service role key - you need to do this once per environment | |
select | |
vault.create_secret ( | |
'<your-key-here>', | |
'service_role_key', | |
'Supabase service_role key' | |
); | |
select | |
vault.create_secret ( |
This file contains hidden or 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
import { cleanEnv, Spec, str, ValidatorSpec } from 'envalid' | |
// https://github.com/af/envalid | |
/** | |
* This module is the single source of truth for application environment configuration. | |
* When imported as a TypeScript module, it provides runtime access to validated environment variables. | |
* When executed as a script, it may cover the following use cases: | |
* - validate current environment | |
* - load current environment beforehand (when CLI flag --force-load-env is used) |
This file contains hidden or 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
#!/bin/sh | |
# Save file in executable PATH, e. g. /usr/bin | |
# Usage: "git fullclean" | |
git checkout develop | |
git pull --rebase | |
git fetch --prune | |
BRANCHES_TO_KEEP_REGEX="(^\*|master|develop)" |
This file contains hidden or 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
/** Demo showing how to sequentially trigger UI actions to put the a web application in a desired debug state | |
* - requires jQuery | |
* - run code when basic UI is ready, e. g. 'domready' callback or Angular controller function | |
* - events of indeterminable duration (e. g. asynchronous loading) are not respected ; tweak interval to suit your needs | |
*/ | |
var ACTION_INTERVAL = 400; // ms | |
var actions = [ | |
function enterSearchTerm() { |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# Takes a list of (A)RGB colors as hex strings and | |
# applies the first color's hue value as a tint to | |
# every other color while preserving saturation, value and alpha. | |
# Supported hex formats: RGB, ARGB | |
# usage: {command} {tint reference color} {first color to tint} [{more colors to tint} ...] | |
# example usage: rgb_tinter.py "#ff00ff" "#123456" "#abcdef" "#001122" |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import os.path | |
import time | |
import datetime | |
import sys | |
import shutil | |
from os import listdir, mkdir | |
from os.path import isfile, join, basename |
This file contains hidden or 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
#!/bin/bash | |
# Grabs an ProGuard-obfuscated Android stack trace from the OSX pasteboard, deobfuscates it using the given mapping.txt and writes the result back to the pasteboard. | |
RETRACE_BIN="retrace.sh" | |
MAPPING_FILE=$1 | |
TMP_FILE="/tmp/"$(basename $0)"_tmp_outfile.txt" | |
if [ -z "$MAPPING_FILE" ]; then | |
echo "Mapping file is not given." |
This file contains hidden or 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
#!/bin/bash | |
# Obtains basic Android device information for debugging and reporting purposes and prints it to stdout. | |
# * adb needs to be installed | |
# * exactly one device needs to be connected | |
LAST_BRACKET_REGEX="\ \[(.*)\]" | |
declare -a PROPS_KEYS=("ro.build.version.release" "ro.product.manufacturer" "ro.product.model" "ro.product.locale.language" "ro.product.locale.region" "gsm.sim.state") |
This file contains hidden or 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
var Crawler = require('crawler'); | |
var url = require('url'); | |
var fs = require('fs'); | |
var NUM_PAGES = 10; | |
var OUTPUT_JSON_FILENAME = 'file_index.json'; | |
var OUTPUT_TXT_FILENAME = 'file_index.txt'; | |