Skip to content

Instantly share code, notes, and snippets.

View madisonbullard's full-sized avatar
🤺
Fencing

Madison Bullard madisonbullard

🤺
Fencing
View GitHub Profile
@karpathy
karpathy / add_to_zshrc.sh
Created August 25, 2024 20:43
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@mattkinnersley
mattkinnersley / auth.$path.tsx
Last active August 23, 2024 06:44
SST Ion Auth + Remix
export async function loader({ request, params }: LoaderFunctionArgs) {
if (params.path === "callback") {
const { searchParams } = new URL(request.url);
const code = searchParams.get("code");
if (code) {
const response = await fetch(import.meta.env.VITE_AUTH_URL + "/token", {
method: "POST",
body: new URLSearchParams({
grant_type: "authorization_code",
@claughinghouse
claughinghouse / functions_src_auth.ts
Created November 28, 2023 19:32
SvelteKit and SST Auth
# This file is in the sveltekit parent directory and is a seperate stack for SST.
import { Account } from "@rebut/core/account";
import { Config } from "sst/node/config";
import { AuthHandler, GoogleAdapter } from "sst/node/future/auth";
import { sessions } from "./sessions";
export const handler = AuthHandler({
sessions,
providers: {
@dalegaspi
dalegaspi / Dependencies.scala
Last active October 9, 2019 16:17
Using Postgesql with TypeSafe Slick 3.1.1
// for use with your build.sbt
object Dependencies {
// ... all your other dependencies
val typesafeSlick = "com.typesafe.slick" %% "slick" % "3.1.1"
val postgreSql = "org.postgresql" % "postgresql" % "9.4.1209"
val hikariCP = "com.typesafe.slick" %% "slick-hikaricp" % "3.1.0" // you need really need this or you get ClassNotFoundException
}
anonymous
anonymous / gist:10675250
Created April 14, 2014 19:11
Motion Blur + Chromatic Aberration
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
@ijy
ijy / gist:2017411
Created March 11, 2012 17:55
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after