Skip to content

Instantly share code, notes, and snippets.

View jrt324's full-sized avatar

JRT jrt324

View GitHub Profile
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@5cover
5cover / Extensions.cs
Created June 6, 2023 21:02
C# Task WithTimeout() extension method
public static async Task WithTimeout(this Task task, TimeSpan timeout)
{
CancellationTokenSource cts = new();
if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)))
{
cts.Cancel();
}
else
{
throw new TimeoutException();
@TheJLifeX
TheJLifeX / 01-README.md
Last active February 22, 2024 19:31
Simple Hand Mouvement Recognition Code - Hand tracking - Mediapipe

Simple Hand Mouvement Recognition Code - Hand tracking - Mediapipe

Goal of this gist is to recognize some simple hand mouvements like Scrolling, Zoom in/out and Slide left/right (see 08-hand-mouvement.gif below).

The whole code for that can be found here: hand-mouvement-recognition-calculator.cc.

You can clone my forked version of mediapipe here: https://github.com/TheJLifeX/mediapipe. I have already commited all code in that repository in the "hand-mouvement-recognition" branch (https://github.com/TheJLifeX/mediapipe/tree/hand-mouvement-recognition).

If you want to know how to recognize hand gesture like ONE, TWO, TREE, FOUR, FIVE, SIX, YEAH, ROCK, SPIDERMAN and OK. You can read this gist: [Simple Hand Gesture Recognition](https://gist.github.com/TheJLifeX/74958cc59db477a91837244ff5

namespace Demo
{
using FluentValidation;
using FluentValidation.Internal;
using FluentValidation.Validators;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using StructureMap;
@ludoo0d0a
ludoo0d0a / macos_finder_open_folder_in_IntelliJ
Last active April 20, 2023 06:14
Open folder into IntelliJ from MacOs Finder
# How to oget an icon to easily open folder into IntelliJ from MacOs Finder
Use tools made with Automator (better, faster, stronger...) :
https://github.com/ludoo0d0a/open-in-buttons-for-finder-toolbar
:)
# Here is the old deprecated way :
(Multiple finder or multiple idea projects works badly)
@fcharlie
fcharlie / profile.json
Last active July 22, 2024 08:08
My Windows Terminal profile.json
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active March 20, 2025 19:02
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@int128
int128 / RequestAndResponseLoggingFilter.java
Last active December 12, 2024 07:41
Spring Web filter for logging request and response
/*
Copyright 2017 Hidetake Iwata
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ciarancolgan
ciarancolgan / Extension to @ondravondra 's: "C# extension for executing upsert (MERGE SQL command) in EF with MSSQL"
Last active November 19, 2018 09:42
EF6 extension to perform an UPSERT. Original here: https://gist.github.com/ondravondra/4001192. This is actually an extension of a fork from this by @x4m, which allowed for an IEnumerable to be passed in. This version contains the additions: i) Get the name of the primary key for the table from the EntityContainerMapping as we wish to exclude th…
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Core.Mapping;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;