Skip to content

Instantly share code, notes, and snippets.

View solrevdev's full-sized avatar
💭
🤓

John Smith solrevdev

💭
🤓
View GitHub Profile
@jeangatto
jeangatto / vscode.settings.json
Last active May 4, 2026 12:54
VS Code Settings (for C# and Copilot AI)
{
// Language-specific formatter settings: choose the default formatter for each file type.
// This makes sure HTML, CSS, JS, JSON, and TypeScript files are formatted consistently.
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features",
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[javascript]": {
#!/usr/bin/env bash
PLIST=~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist
CURRENT_DATE=$(date +%s)
ONE_YEAR_FROM_NOW=$(date -v+1y +%s)
if [ -f "$PLIST" ]; then
# Contents of the plist file look like this:
# Dict { /Applications/1Password.app/Contents/MacOS/1Password = Sat Sep 21 11:59:57 PST 2024 /Applications/Microsoft Teams.app/Contents/MacOS/MSTeams = Tue Sep 21 05:40:36 PST 3024 /Applications/CleanShot X.app/Contents/MacOS/CleanShot X = Tue Sep 21 05:40:36 PST 3024 /Applications/Ice.app/Contents/MacOS/Ice = Sat Sep 21 05:40:36 PST 2024 /Applications/Shottr.app/Contents/MacOS/CleanShot X = Tue Sep 21 05:40:36 PST 3024 }
@trvswgnr
trvswgnr / compress_video
Last active April 23, 2026 21:29
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@ColeMurray
ColeMurray / automated-crawl.py
Created August 10, 2024 23:29
Automated Website Data Extraction
import json
import logging
import time
from typing import Dict, Any
import requests
from bs4 import BeautifulSoup
from openai import OpenAI
from requests.exceptions import RequestException
from tenacity import retry, stop_after_attempt, wait_random_exponential
@markflorkowski
markflorkowski / handler.js
Last active September 26, 2024 18:14
Clerk New Users - Discord Transform
function handler(webhook) {
const {data: user} = webhook.payload;
// Extract relevant details
const emailAddress = user.email_addresses?.[0]?.email_address || 'Unknown user';
const firstName = user.first_name || '';
const lastName = user.last_name || '';
const fullName = `${firstName} ${lastName}`.trim() || emailAddress;
const profileImageUrl = user.profile_image_url || 'https://www.gravatar.com/avatar?d=mp';
const createdAt = new Date(user.created_at).toLocaleString();
string firstLastName = "KarenPayne";
var separated = firstLastName.SplitByCase();
@dan-palmer
dan-palmer / prompt.json
Created February 2, 2024 13:49
Arc Search Browse for Me Prompt
{
"messages": [
{
"content": "You are an advanced, reliable, candid AI system that takes user search queries, converts them into questions, and answers them, using specific facts and details sourced from webpages to prove your answer. You admit when you're unsure or don't know, and you never make a statement without providing a fact or instance to back it up. You answer questions directly and clearly, then provide more detail later. You follow the JSON schema exactly.",
"role": "system"
},
{
"content": "# CONTEXT\nCurrent date: #{DATE_TIME}.\n\nHere are result from a web search for '#{QUERY}':\nBEGIN WEB PAGE #{HOST_1} #{MARKDOWN_1}END WEB PAGE\nBEGIN WEB PAGE #{HOST_2} #{MARKDOWN_2}END WEB PAGE\nBEGIN WEB PAGE #{HOST_3} #{MARKDOWN_3}END WEB PAGE\nBEGIN WEB PAGE #{HOST_4} #{MARKDOWN_4}END WEB PAGE\nBEGIN WEB PAGE #{HOST_5} #{MARKDOWN_5}END WEB PAGE\nBEGIN WEB PAGE #{HOST_6} #{MARKDOWN_6}END WEB PAGE",
"role": "system"
},
public enum BookCategories
{
[Description("Options")]
[Display(Name = "Select")]
Select = 0,
[Description("Space Travel")]
[Display(Name = "Space Travel")]
SpaceTravel = 1,
[Description("Adventure")]
[Display(Name = "Adventure")]
@kamilogorek
kamilogorek / _screenshot.md
Last active April 14, 2026 18:02
Clutter-free VS Code Setup
image
@karenpayneoregon
karenpayneoregon / ExceptionHelpers.cs
Created December 23, 2023 16:39
Using Spectre.Console NuGet package to colorize runtime exceptions
/// <summary>
/// Custom setting for presenting runtime exceptions using AnsiConsole.WriteException.
///
/// The idea here is to present different types of exceptions with different colors while
/// one would be for all exceptions and the other(s) for specific exception types.
/// </summary>
public class ExceptionHelpers
{
/// <summary>
/// Provides colorful exception messages in cyan and fuchsia