Skip to content

Instantly share code, notes, and snippets.

View lgersman's full-sized avatar
💭
Stecke voller Bratentang 💪

lars.gersmann lgersman

💭
Stecke voller Bratentang 💪
View GitHub Profile
@lgersman
lgersman / gchat-notify-pull-request.yaml
Last active March 6, 2025 11:53
github workflow to create pr messages in a google chat
#
# this workflow is triggered by pull requests and will notify a google chat room about pull request events
#
# this workflow requires a secret "GCHAT_PR_ANNOUNCEMENTS_WEBHOOK" to point to the google chat room
# if not declared his workflow will set a warning and will exit gracefully (=> without an error)
#
# TODO: we cannot react to single review comments in github pipelines as of now
# See "Add events for pull request review comment resolved/unresolved" https://github.com/orgs/community/discussions/12811
#
name: 'gchat-notify-pull-request'
@lgersman
lgersman / gist:3f82c79e3fe1689d5ee3cf2da63809fb
Created February 6, 2025 13:28
GIT Tip : remove only locally existing branches interactively using gum #gum #bash #git #terminal
_=$(git branch -vv | grep ': gone]' | \
awk '{print $1}' | \
gum choose --header="Select local only branches to delete" --no-limit)
[[ "$?" == '0' ]] && \
printf "Will delete the following branches locally:\n$_\n" && \
gum confirm --show-output 'Do you agree?' && (printf "$_" | \
xargs -n 1 git branch -dvf)
@lgersman
lgersman / create-a-wordpress-bugfix-plus-vscode-xdebug.md
Created January 4, 2025 13:29
notes on setup a local wordpress-develop instance for creating a bugfix using vscode and xdebug
@lgersman
lgersman / wp-env-cloudlfare.sh
Created June 20, 2024 19:07
start a cloudflare quick tunnel (no cloudflare account needed, no cloudflared needs to be installed) to expose your local wp-env development instance to the internet using https
#!/usr/bin/env bash
# starts a cloudflare quick tunnel (no cloudflare account needed, no cloudflared needs to be installed)
# for tunneling a wp-env wordpress site to the internet.
#
# dependencies : bash, docker, jq
#
# the wp-env instance does needed to be started since this script hijacks
# the wp-env instance file "wp-env-home/*/WordPress/wp-config.php"
# the wp-env instance is restarted the quick tunnel will be available
from operator import itemgetter
from langchain.chat_models import ChatOpenAI
from langchain.embeddings import OpenAIEmbeddings
from langchain.schema import StrOutputParser
from langchain.schema.runnable import RunnablePassthrough, RunnableMap
from langchain.vectorstores import Chroma
from langchain.prompts import PromptTemplate
from langchain.document_loaders import JSONLoader
from dotenv import load_dotenv
#!/usr/bin/env bash
# Script will open up fzf to select a monorepo package and show the git commit log for that monorepo package.
# (Start the script in your monorepo root directory)
# Requires:
# - git
# - pnpm
# - fzf >= 0.29.0
#
# Author: Lars Gersmann <[email protected]>
@lgersman
lgersman / rollup.config.js
Created October 16, 2019 10:27
rollup config for a wordpress plugin including scss/es2018 support
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
//import strip from 'rollup-plugin-strip';
import scss from 'rollup-plugin-scss';
import packageJson from './package.json';
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
const createBrowserConfig = (customizeConfig = () => {}) => {
const config =
@lgersman
lgersman / README.md
Last active February 2, 2020 00:18 — forked from anonymous/README.md
improved state diagram editor based on https://gist.github.com/lgersman/5311202 featuring curvy connections with helper points

new features

  • css improved
  • css transitions added

nodes

  • double click on a node to remove it
@lgersman
lgersman / README.md
Last active July 2, 2021 03:41
state diagram editor example based on (https://gist.github.com/lgersman/5311083)
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame
  • circles are draggable
  • circles can be selected (multiple selections possible by pressing CTRL while clicking a circle)
  • the selection frame selects all circles within the frame (by pressing CTRL the selected circles will be appended to current selection)
  • multiple selected circles will be dragged simultaneous

new features:

@lgersman
lgersman / README.md
Last active October 19, 2022 12:15
improved version of my d3.js selection frame example (https://gist.github.com/lgersman/5310854) supporting draggable/selectable nodes
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

new features :

  • circles are draggable
  • circles can be selected (multiple selections possible by pressing CTRL while clicking a circle)
  • the selection frame selects all circles within the frame (by pressing CTRL the selected circles will be appended to current selection)
  • multiple selected circles will be dragged simultaneous