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
# alias to jump to repo root | |
alias zz='cd $(git rev-parse --show-toplevel)' | |
# global cache for repo root | |
typeset -A _ZO_REPO_CACHE | |
# custom zoxide wrapper to prevent leaving the repo | |
function z() { | |
# special cases: use regular zoxide behavior | |
# "-" = jump to previous dir, $HOME = unlikely to be a git repo |
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 { NonRetryableError } from 'cloudflare:workflows' | |
import { initWorkflowSentry } from '../helpers/sentry' | |
import type { WorkflowEvent, WorkflowStep, WorkflowStepConfig } from 'cloudflare:workers' | |
import type { Toucan } from 'toucan-js' | |
import type { Bindings } from '../types' | |
/** Workflow context (similar to Hono context) */ | |
export class WorkflowContext<Params = unknown> { |
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
VERSION 0.8 | |
PROJECT jahands/docker | |
# Local targets: | |
tidy: | |
LOCALLY | |
RUN go mod tidy | |
build-local: | |
LOCALLY |
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 { Client as NotionClient } from '@notionhq/client'; | |
import formatISO from 'date-fns/formatISO' | |
import { utcToZonedTime } from 'date-fns-tz' | |
import { ThrottledQueue, auth } from '@jahands/msc-utils'; | |
let notion: NotionClient; | |
function setup(env: Repeat.Env) { | |
if (!notion) { | |
notion = new NotionClient({ |
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
// https://gist.github.com/jahands/c68b4786d1cea696e61714354c1d3019 | |
import { ThrottledQueue } from '@jahands/msc-utils'; | |
import PQueue from 'p-queue'; | |
// ===== SETUP ===== // | |
// Required ENV vars: | |
// CLOUDFLARE_ACCOUNT_ID | |
// CLOUDFLARE_API_TOKEN | |
// WEBHOOK_KEY |
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
async function statsGraph(params: Params, request: any, env: Env, ctx: ExecutionContext): Promise<Response> { | |
const graphKey = 'uuid.rocks/stats/graph.png' | |
const defaults = { | |
contentType: 'image/png', | |
cacheControl: 'public, max-age=1800', | |
} as const | |
const r2CacheTime = '2 hours' // itty-time format | |
// First check edge cache | |
// @ts-ignore | |
const cache = caches.default |
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
Function ConvertTo-WslPath { | |
Param( | |
[Parameter(Mandatory = $true, ValueFromPipeline)] | |
[string]$Path | |
) | |
$p = Get-Item $Path | |
$wslPath = "/mnt/$($p.PSDrive.Name.ToLower())$($p.FullName.Substring($p.FullName.IndexOf(':')+1).Replace('\','/'))" | |
$wslPath | |
} |
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
# This version is for very large datasets that might be too big for Wrangler | |
# You might have to run `sed -i '1s/^\xEF\xBB\xBF//' FILE.json` on the output file if wrangler gives errors | |
# Example row of data: | |
# Slug ID : 2723 | |
# Slug Name : AJ_FV057 | |
# Report Title : Wholesale Market Asian Vegetable Report - Atlanta, GA (AJ_FV057) | |
# Published Date : 2/24/2021 12:10 | |
# Report Date : 2/24/2021 | |
# Report Status : Final |
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
// ==UserScript== | |
// @name Replit_New_Namer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Sets the name based on the url when using repl.new. Eg. repl.new/py/my awesome python project | |
// @author Jacob Hands | |
// @match https://replit.com/new/* | |
// @grant none | |
// ==/UserScript== |
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 { Router, Method, Params } from 'tiny-request-router' | |
// Let the router know that handlers are async functions returning a Response | |
type Handler = (params: Params, request: Request) => Promise<Response> | |
const router = new Router<Handler>() | |
router.get('/upload/:name', async (params: Params, request: Request) => upload(params, request)) | |
export async function handle(event: FetchEvent): Promise<Response> { | |
let request = event.request |
NewerOlder