Skip to content

Instantly share code, notes, and snippets.

@choco-bot
choco-bot / FilesSnapshot.xml
Created February 11, 2025 22:05
vscode v1.97.1 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\vscode\vscode.nupkg" checksum="F37B0F129E96D46F25B9A5D4F3E41DC0" />
<file path="C:\ProgramData\chocolatey\lib\vscode\vscode.nuspec" checksum="69FB0252A1B2198C9E8C1C04AD5C4CCE" />
</files>
</fileSnapshot>
[Fact]
public void Divide_ShouldThrowException_WhenDividingAnyNumberByZero()
{
// Act
var result = () => _calculator.Divide(1, 0);
// Assert - FluentAssertions
result.Should().Throw<DivideByZeroException>()
.WithMessage("Cannot divide by zero.");
@shopper-myles
shopper-myles / example.tsx
Created February 11, 2025 22:05
Example of instrumentation
import {onCLS, onTTFB} from 'web-vitals';
const entryTypes = [
'navigation',
'visibility-state',
'measure',
'long-animation-frame',
'resource',
'paint',
] as const;
@gardient
gardient / unattended-upgrades-repos.py
Created February 11, 2025 22:05
a python script to get the repos you are missing from unattended upgrades
import os, re, pdb, distro
from pprint import pprint
## Get the repos
PATH = "/var/lib/apt/lists/"
files = os.listdir(PATH)
release_files = [file for file in files if file.endswith("Release")]
ORIGIN_PATTERN = re.compile("Origin: (.*)\n")
SUITE_PATTERN = re.compile("Suite: (.*)\n")
@lvanasse
lvanasse / ci-risc-v-06.log
Created February 11, 2025 22:05
[risc-v-06] CI Log for nuttx @ 381d3fe64f4da2b09f12bd8f0cd2d1f07d86b3d3 / nuttx-apps @ fb0c1e10ded2a6fb9f066b9893662cbcc86e4646
fpu.c:57:8: warning: #warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)" [-Wcpp]
Script started on 2025-02-11 21:42:17+00:00 [COMMAND="/home/ludovic/nuttx-release/run-job.sh risc-v-06" <not executed on terminal>]
Now running https://github.com/lupyuen/nuttx-release/blob/main/run-job.sh
Called by https://github.com/lupyuen/nuttx-release/blob/main/run-ci.sh
+ job=risc-v-06
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
-+ssssssssssssssssssyyssss+-
.ossssssssssssssssssdMMMNysssso.
@choco-bot
choco-bot / Install.txt
Created February 11, 2025 22:04
psservice v2.25 - Failed - Package Tests Results
2025-02-11 22:04:34,589 880 [DEBUG] - XmlConfiguration is now operational
2025-02-11 22:04:34,712 880 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,733 880 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,733 880 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,733 880 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,733 880 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,746 880 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,746 880 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:04:34,746 880 [DEBUG] - Adding new type 'RubyGe
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 11, 2025 22:04
Rimworld output log published using HugsLib
Log uploaded on Wednesday, February 12, 2025, 6:04:12 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Visual Exceptions(brrainz.visualexceptions)[mv:1.3.2.0]: CrossPromotion(1.1.2), VisualExceptions(1.3.2)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Anomaly(Ludeon.RimWorld.Anomaly): (no assemblies)
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)
@choco-bot
choco-bot / Install.txt
Created February 11, 2025 22:03
pspasswd v1.24 - Failed - Package Tests Results
2025-02-11 22:03:33,925 5844 [DEBUG] - XmlConfiguration is now operational
2025-02-11 22:03:34,048 5844 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,048 5844 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,065 5844 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,065 5844 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,065 5844 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,081 5844 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,081 5844 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:03:34,081 5844 [DEBUG] - Adding new typ
@Ifihan
Ifihan / main.md
Created February 11, 2025 22:03
Remove All Occurrences of a Substring

Question

Approach

I start by using a while loop to check if the substring part exists in s. As long as part is present, I keep removing the first occurrence of it using s.replace(part, "", 1). This ensures that I only remove one instance at a time, starting from the left. I repeat this process until part no longer appears in s. Once all instances are removed, I return the modified string.

Implementation

class Solution:
 def removeOccurrences(self, s: str, part: str) -&gt; str:
@choco-bot
choco-bot / Install.txt
Created February 11, 2025 22:02
psloggedon v1.35 - Failed - Package Tests Results
2025-02-11 22:02:34,028 3388 [DEBUG] - XmlConfiguration is now operational
2025-02-11 22:02:34,154 3388 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,154 3388 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,154 3388 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,154 3388 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,172 3388 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,172 3388 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,172 3388 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:02:34,184 3388 [DEBUG] - Adding new typ