Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@iocanel
iocanel / pre-commit
Created May 12, 2022 07:04
Git pre-commit hook to prevent pdf and adoc changes in the same commit
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@iocanel
iocanel / get-current-user.lisp
Created October 18, 2021 19:45
Get the current user from the github buffer
(defun github-current-user ()
"Get the curently logged in user."
(let ((page-source (if (web-buffer-p (current-buffer))
(plump:serialize (document-model (current-buffer)) nil)
(ffi-buffer-get-document (current-buffer)))))
(ppcre:register-groups-bind (user) (".*<meta name=\"user-login\" content=\"([a-zA-Z0-9_-]+)\">.*" page-source) user)))
@iocanel
iocanel / video-notes.org
Last active March 25, 2024 00:12
Taking notes from videos using Emacs

Video Notes

Introduction

This document describes my setup for taking notes from videos, using Emacs and org-mode.

My goals:

  • Embed & playback video links into my notes
  • Generate, embed & post process animated from my notes
@iocanel
iocanel / dependency-per-release.sh
Created April 15, 2020 09:46
For each release show which version of the specified depnency was used.
#!/bin/bash
DEPENDENCY=$1
git log | grep "prepare release" -B4 | grep commit | cut -d " " -f2 | while read commit
do
release=`git log | grep $commit -A4 | grep maven-release-plugin | awk -F " " '{print $NF}'`
version=`git show $commit:pom.xml | grep "<${DEPENDENCY}.version>" | awk -F ">|<" '{print $3}'`
echo "Release: $release $DEPENDENCY $version"
done
@iocanel
iocanel / nutrition.org
Last active February 12, 2024 03:05
Nutrition tracking with Emacs and Org Mode

Nutrition tracking using Emacs

This is not a blog post. This is my Emacs powered nutrition tracker!

No, I mean it!

It’s the one file that contains all the code, templates and data of my tracker,

@iocanel
iocanel / kube-apply-selection.sh
Last active March 25, 2020 20:26
Apply selection to kubernetes
#!/bin/sh
#
# Grabs the selected text and apply it to kubernetes using `kubectl`.
#
# OS: Linux
# Requirements: xsel, notify-send
#
# Bind this to a key of your choice.
# Example (i3):
package io.snowdrop.github.issues;
import java.util.Arrays;
import java.util.Set;
import io.quarkus.arc.config.ConfigProperties;
@ConfigProperties(prefix = "github.bridge")
public class BridgeConfig {
[ERROR] Plugin io.quarkus:quarkus-maven-plugin:999-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for io.quarkus:quarkus-maven-plugin:jar:999-SNAPSHOT: 2 problems were encountered while building the effective model for io.quarkus:quarkus-maven-plugin:999-SNAPSHOT
[ERROR] [ERROR] 'dependencies.dependency.version' for io.quarkus:quarkus-platform-descriptor-legacy:jar is missing. @
[ERROR] [ERROR] 'dependencies.dependency.version' for org.glassfish:javax.json:jar is missing. @
@iocanel
iocanel / gist:bd5f428c4b12a82992f553678c6cd0a5
Last active February 5, 2019 16:35
Install prometheus operator locally
oc cluster up
# Tried with both coreos repo and its openshfit fork
git clone git@github.com:openshift/prometheus-operator.git
cd prometheus-operator
# Remove all RunAsUser: 65543 as they don't work on openshift
ls contrib/kube-prometheus/manifests/* | while read manifest; do echo "Removing RunUser from $manifest"; sed -i '/65543/d' $manifest;done
# This suffers from a race condition so lets install resources one by one and add some sleep
ls contrib/kube-prometheus/manifests/* | while read manifest; do echo "Installing $manifest"; oc create -f $manifest; sleep 1;done
#!/bin/bash
pushd ~/workspace/src/github.com/syndesisio/syndesis
./app/build.sh --clean --openshift -f
oc create -f app/deploy/support/serviceaccount-as-oauthclient-restricted.yml
oc create -f app/deploy/syndesis-restricted.yml
oc new-app syndesis-restricted -p ROUTE_HOSTNAME=syndesis.$(minishift ip).nip.io -p OPENSHIFT_MASTER=$(oc whoami --show-server) -p OPENSHIFT_PROJECT=$(oc project -q) -p OPENSHIFT_OAUTH_CLIENT_SECRET=$(oc sa get-token syndesis-oauth-client)
popd