Skip to content

Instantly share code, notes, and snippets.

@andrictham
andrictham / route.ts
Created May 28, 2024 13:26
ZenStack, Clerk, and Next 14 App Router
import { prisma } from "@/server/db";
import { auth } from "@clerk/nextjs/server";
import { enhance } from "@zenstackhq/runtime";
import { NextRequestHandler } from "@zenstackhq/server/next";
// Async but no await needed for Clerk auth(), as per ZenStack's Clerk integration docs
// eslint-disable-next-line @typescript-eslint/require-await
async function getPrisma() {
const authObject = auth(); // Clerk's auth() is synchronous
@andrictham
andrictham / _EXAMPLE_TWITTER_SCRAPER.md
Created April 2, 2024 11:24 — forked from masterkram/cities.json
Example Twitter replies scraper

Many of the things above are admitedly hardcoded and hacky. 😄

First I ran getTweetsOnPage() and navigated around manually. Then I rand downloadTweets() to get the json file with tweets.

  • parent: main tweet.
  • replies: replies to the main tweet.

@andrictham
andrictham / SketchSystems.spec
Last active September 2, 2019 11:48
# Structure is similar to Github, with private and public experiences
# Structure is similar to Github, with private and public experiences
tandem pm
Public directory*
Home -> tandem pm
Log in -> Logged in experience
Sign up -> Sign up flow
Directory overview*
Browse categories -> Category page
@andrictham
andrictham / bd3d4befe38185704bf0fc875e9deed6|configuration.json
Last active December 5, 2018 11:01
Visual Studio Code Settings Sync Gist
{"contents":{"editor":{"formatOnSave":true},"tslint":{"autoFixOnSave":true}},"overrides":[],"keys":["editor.formatOnSave","tslint.autoFixOnSave"]}

Keybase proof

I hereby claim:

  • I am andrictham on github.
  • I am andric (https://keybase.io/andric) on keybase.
  • I have a public key ASA8weFiyf5q7P2noth8Y7mIR8d4ysaeFjYE862OruA_SAo

To claim this, I am signing this object:

@andrictham
andrictham / Singjazz-README.md
Created May 10, 2017 05:08
Example README.md for frontend projects
@andrictham
andrictham / no-touch-select.scss
Created April 27, 2017 09:27
SCSS mixin for preventing touch, highlight, text select for webkit
@mixin no-touch-select {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color*/
-webkit-tap-highlight-color: transparent; /* prevent tap highlight color*/
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
//how to use it