Skip to content

Instantly share code, notes, and snippets.

@jescalan
jescalan / handle-error.ts
Created February 11, 2025 17:40
jeff's error handling thing
import * as Sentry from '@sentry/nextjs';
import posthog from 'posthog-js';
import debug from './debug';
const genericErrorMessage =
'Something went wrong, our developers have been notified and will reach out to you shortly to resolve the issue. So sorry for the inconvenience!';
/**
* Given an error, logs it to the console in dev environment, logs to sentry in
* production, and returns a generic error message for the user. If a "error"
@nuttxpr
nuttxpr / ci-risc-v-03.log
Created February 11, 2025 17:39
[risc-v-03] CI Log for nuttx @ 381d3fe64f4da2b09f12bd8f0cd2d1f07d86b3d3 / nuttx-apps @ fb0c1e10ded2a6fb9f066b9893662cbcc86e4646
Script started on 2025-02-11 23:37:54+07:00 [COMMAND="/home/user/nuttx-release/run-job.sh risc-v-03 " TERM="xterm-256color" TTY="/dev/pts/5" COLUMNS="110" LINES="83"]
Now running https://github.com/lupyuen/nuttx-release/blob/main/run-job.sh risc-v-03
Called by https://github.com/lupyuen/nuttx-release/blob/main/run-ci.sh
+ job=risc-v-03
+ [[ risc-v-03 == '' ]]
+ instance=
+ set
+ grep TMUX
+ true
+ neofetch
@m-hamzak
m-hamzak / Swift-Protocols-Sample-App-Services.swift
Created February 11, 2025 17:38
Service responsible for providing user data
// Protocol for user data fetching
protocol UserServiceProtocol {
func getUsers() -> [User]
}
// Service responsible for providing user data
class UserService: UserServiceProtocol {
func getUsers() -> [User] {
return [User(id: 1, name: "Hamza Khalid One", email: "hamza1@example.com"),
User(id: 2, name: "Hamza Khalid Two", email: "hamza2@example.com")]
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 11, 2025 17:37
Rimworld output log published using HugsLib
Log uploaded on Wednesday, February 12, 2025, 2:37:24 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Big and Small - Framework(RedMattis.BetterPrerequisites): BetterPrerequisites(1.0.0), BSXeno(1.0.0), RedHealth(1.0.0)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
Better Gene Graphics Framework(telardo.BetterGeneGraphicsFramework): BetterGeneGraphicsFramework(1.0.0)
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{pgfplots}
@GarrettMooney
GarrettMooney / build.sh
Created February 11, 2025 17:36
Install geo_polars plugin from python polars book
#!/usr/bin/env bash
# install rustup if it doesn't exist
if ! command -v rustup &> /dev/null
then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
# install uv if it doesn't exist
if ! command -v uv &> /dev/null
edges = cv2.Canny(image, 100, 200)
@cemalley
cemalley / python_table_equivalent.py
Created February 11, 2025 17:35
python's equivalent of table()
print(data['edu'].value_counts())
@simonewebdesign
simonewebdesign / pomodoro_timer.sh
Created February 11, 2025 17:35
Simple pomodoro timer Bash script (macOS)
#!/bin/bash
# Function to send a macOS notification
send_notification() {
osascript -e 'display notification "'"$1"'" with title "'"$2"'"'
}
# Function to display a countdown in the terminal
countdown_timer() {
local time_left=$1
#!/bin/sh
set -e
# Docker Engine for Linux installation script.
#
# This script is intended as a convenient way to configure docker's package
# repositories and to install Docker Engine, This script is not recommended
# for production environments. Before running this script, make yourself familiar
# with potential risks and limitations, and refer to the installation manual
# at https://docs.docker.com/engine/install/ for alternative installation methods.
#