Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
☸️

Chmouel Boudjnah chmouel

☸️
View GitHub Profile
(defun golang-test-detect (&optional rg-extras)
(interactive)
(let ((results))
(with-temp-buffer
(insert (shell-command-to-string "rg -g '*_test.go' '^func\sTest'"))
(goto-char (point-min))
(while (re-search-forward "^\\(.+\\):func \\([a-zA-Z_]*\\)" nil t)
(let ((filename (match-string 2)))
(push (format "%s :: %s" (match-string 1) (match-string 2)) results))))
results))
@chmouel
chmouel / PKGBUILD
Created November 29, 2022 11:51
Git trim openssl arch package fix
# Maintainer: Wesley Moore <wes@wezm.net>
pkgname=git-trim
pkgver=5686c48
pkgrel=2
pkgdesc='Trims your git remote tracking branches'
arch=('i686' 'x86_64')
url="https://github.com/foriequal0/git-trim"
license=('MIT')
depends=('libgit2')
makedepends=('cargo')
apiVersion: v1
baseDomain: devcluster.openshift.com
compute:
- hyperthreading: Enabled
name: worker
platform: {}
replicas: 3
controlPlane:
hyperthreading: Enabled
name: master
diff --git a/pkg/matcher/cel.go b/pkg/matcher/cel.go
index 822d8812..c0a9a416 100644
--- a/pkg/matcher/cel.go
+++ b/pkg/matcher/cel.go
@@ -5,8 +5,11 @@ import (
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker/decls"
+ "github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
@chmouel
chmouel / cargo.toml
Last active May 5, 2022 20:17
Querying tekton objects with Rust, dynamic clients and tokio
[package]
name = "tekton-rs"
version = "0.1.0"
authors = ["Chmouel Boudjnah <chmouel@chmouel.com>"]
edition = "2018"
[dependencies]
kube = { version = "0.71.0", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.14.0", features = ["v1_23"] }
tokio = { version = "1.14.0", features = ["full"] }
@chmouel
chmouel / back-and-forth.applescript
Last active March 27, 2022 07:01
Focus back and forth between an application (kitty) to the previous window
global previousWin
on getFrontWin()
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
return frontAppName
end tell
end getFrontWin
@chmouel
chmouel / buildah-task.yaml
Last active February 23, 2023 20:20
Openshift Pipelines Buildah task rootless
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: buildah-userns
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: image-build
ARG BASE_IMG=registry.access.redhat.com/ubi8/ubi
FROM $BASE_IMG AS buildah-runner
RUN useradd buildah; echo buildah:10000:5000 > /etc/subuid; echo buildah:10000:5000 > /etc/subgid;
# https://github.com/containers/buildah/blob/main/docs/tutorials/05-openshift-rootless-build.md
# https://github.com/containers/buildah/blob/master/contrib/buildahimage/stable/Dockerfile
# https://github.com/containers/buildah/issues/1011
# https://github.com/containers/buildah/issues/3053
{
"settingsVersion": "1.67",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": "/jkg"
},
{
"pattern": "https?://feedly.com/*",
"passKeys": "gjk"
@chmouel
chmouel / bump-release.sh
Created November 24, 2021 17:57
Bump a release from shell
#!/usr/bin/env bash
# need python-semver package https://pypi.org/project/semver/
set -euf
VERSION=${1-""}
bumpversion() {
current=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Current version is ${current}"