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 / 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,
@joshpetit
joshpetit / dtsp
Created September 10, 2020 19:31
Download the last taken screenshot to your phone via kdeconnect
# !bin/bash
file=$(ls -Art ~/Pictures/| grep Screenshot\ from\ | tail -n 1)
kdeconnect-handler ~/Pictures/"$file"