Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
@chmouel
chmouel / doloop.zsh
Created April 23, 2025 13:03
doloop function again and again
doloop () {
local timeout label
label="Press any key to continue"
[[ $1 == -t* ]] && {
timeout="-t${1#-t}"
label="Waiting for ${1} seconds, or press any key to continue"
shift
}
[[ ${1} == "-n" ]] && {
shift

I am going to copy you a jira template, and I will be copying to you a bunch of discussions and context after that, can you help me make the jira issue and provide a title for it? Make sure to output as jira formatting and make it easy to copy and paste directly on the jira textbox

Jira Template


h1. Story (Required)
@chmouel
chmouel / git-clone-rebase.yaml
Created April 9, 2025 07:57
git clone with merge
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
# NOTE: Changed name to avoid conflict with the original
name: git-clone
labels:
app.kubernetes.io/version: "0.10"
annotations:
tekton.dev/pipelines.minVersion: "0.38.0"
tekton.dev/categories: Git
You are a release notes generator. You will receive markdown-formatted pull request information and transform it into a well-structured release note following a specific format.
Input Format:
The input will be markdown content containing pull request information grouped by labels. Each PR entry includes title, number, author, merge date, URL, and description.
Task:
Transform this information into a release note following these exact rules:
1. Start with the title "OpenShift Pipelines as Code v[VERSION]"
sequenceDiagram
    participant User
    participant Orchestrator
    participant MinionController
    participant PipelineController
    participant MinionReconciler

    User->>Orchestrator: Create pending PipelineRun with annotation (tektoncd.dev/orchestration: true)
    Orchestrator->>Orchestrator: Detects PipelineRun with orchestration annotation
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")
((nil . ((compile-command . "make -C $(git rev-parse --show-toplevel) lint-go")
(projectile-git-command . "fdfind -0")
(projectile-project-test-cmd . "make test lint")))
(nil . ((eval . (add-to-list 'dape-configs
`(pac-watcher
modes (go-mode go-ts-mode)
ensure dape-ensure-command
@chmouel
chmouel / my-gotest-sub.el
Created November 29, 2024 10:04
Use treesitter to get gotest subtests and function name
(defvar my-gotest-get-subtest-key "name")
(defun my-gotest-get-subtest-ts ()
(let* ((struct-node (treesit-parent-until
(treesit-node-at (point))
(lambda (n)
(string-equal (treesit-node-type n) "literal_value"))))
(funcname
(substring-no-properties
(treesit-node-text
@chmouel
chmouel / pytest.golden.py
Last active January 26, 2025 21:44
golden files comparaison and update on python with pytest
import json
import os
import pathlib
import pytest
@pytest.fixture
def fixtdir(request):
return pathlib.Path(request.module.__file__).parent / "fixtures"
from datetime import datetime, timedelta
def calculate_start_date_and_months(end_date_str, num_weeks):
# Convert end_date_str to a datetime object
end_date = datetime.strptime(end_date_str, "%Y-%m-%d")
# Calculate the number of days to subtract
num_days = num_weeks * 7
@chmouel
chmouel / focus_or_open.ahk
Last active October 1, 2024 18:33
Focus or open msedge or windowsterminal on win+w or win+j
#Requires AutoHotkey v2.0
global previousWindow := ""
; Define a function to focus or open
FocusOrOpen(exe, runit) {
global previousWindow
edgeWindow := "ahk_exe " . exe
; Check if Microsoft Edge is already open
if WinExist(edgeWindow) {