Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {string} s | |
* @param {string} part | |
* @return {string} | |
*/ | |
var removeOccurrences = function(s, part) { | |
// Loop until there are no more occurrences of 'part' in 's' | |
while (s.includes(part)) { | |
// Replace the first occurrence of 'part' with an empty string | |
s = s.replace(part, ""); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edges = cv2.Canny(image, 100, 200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(data['edu'].value_counts()) |