Skip to content

Instantly share code, notes, and snippets.

View joshpetit's full-sized avatar
🟩
God is Good, Life is Good, can't ask for more.

Joshua Petitma joshpetit

🟩
God is Good, Life is Good, can't ask for more.
View GitHub Profile
@joshpetit
joshpetit / reset-password.ts
Created June 26, 2024 03:34
Supabase and nextjs password reset page
"use client";
import { SubmitButton } from "../login/submit-button";
import { redirect } from "next/navigation";
import { createBrowserLocaleClient } from "@/utils/supabase/client";
import { useEffect, useState } from "react";
export default function ResetPassword() {
const supabase = createBrowserLocaleClient();
const [accessToken, setAccessToken] = useState("");
const [refreshToken, setRefreshToken] = useState("");
@joshpetit
joshpetit / firestore-delete-users.js
Last active June 11, 2022 02:37
Deletes all the users in firebase. Max 8,000 at a time
var admin = require('firebase-admin');
var serviceAccount = require("./service-account.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "/url/to/your/database"
});
function deleteUser(uid) {
@joshpetit
joshpetit / config.json
Created May 12, 2022 05:33
Dart-code configuration options
{
"adapters" {
"dart-code": {
"name": "dart",
"command": [
"node",
"$HOME/.vscode/<PATH TO BUNDLE>/src/debug/dart_debug_entry.js"
],
"attach": {
"pidProperty": "observatoryUri",
@joshpetit
joshpetit / usingLinux.md
Created December 13, 2021 21:55
Awesome sotware to try
@joshpetit
joshpetit / filters.scm
Last active October 6, 2021 13:45
Scheme functions
(define filters
(lambda ((pred <function>) (stream <stream>))
(cond ((stream-empty? stream) stream)
((pred (stream-first stream))
(stream-cons (stream-first stream)
(filters pred (stream-rest stream))))
(else (filters pred (stream-rest stream))))))
@joshpetit
joshpetit / fbd.dart
Created September 29, 2021 11:49
Find flutter widget by descendent
textField = find.descendant(
of: find.byKey(const Key('eventDescriptionField')),
matching: find.byKey(const Key('textField')),
);
@joshpetit
joshpetit / createUser.js
Last active March 26, 2024 08:18
Firebase emulator REST API request examples
var fetch = require('node-fetch');
(async () => {
await fetch(
`http://localhost:9099/identitytoolkit.googleapis.com/v1/accounts:signUp?key=fakeapi`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: "user@test.com",
" Vim color file
" purple
" Created by with ThemeCreator (https://github.com/mswift42/themecreator)
hi clear
if exists("syntax on")
syntax reset
endif
@joshpetit
joshpetit / General.regex
Last active November 2, 2020 11:44
Bible reference regex with groupings
([1-3]?(?=[ ]*)\b[A-Za-z]+\b) ?(\d+)?:?(\d+)?-?(\d+)?
@joshpetit
joshpetit / Books.dart
Last active October 12, 2020 23:51
The bible books in different formats
{
'Genesis': 1,
'Exodus': 2,
'Leviticus': 3,
'Numbers': 4,
'Deuteronomy': 5,
'Joshua': 6,
'Judges': 7,
'Ruth': 8,
'1 Samuel': 9,