Skip to content

Instantly share code, notes, and snippets.

@jajm
jajm / autoredraw-steam-window.sh
Last active November 18, 2024 17:27
Force Steam window redraw when switching workspace (i3)
#!/bin/sh
is_steam_on_current_workspace () {
printf '%s' "$1" | jq -e '.current.nodes.[] | select(.name == "Steam")' > /dev/null
}
while json=$(i3-msg -t subscribe '["workspace"]'); do
if is_steam_on_current_workspace "$json"; then
i3-msg -q '[class="steam"] border pixel 1'
sleep 0.1
@jajm
jajm / manifest.json
Last active September 21, 2023 07:45
{
"@context": "http:\/\/iiif.io\/api\/presentation\/3\/context.json",
"id": "https:\/\/transcrire.histolab.fr\/iiif-presentation\/3\/item\/18611\/manifest",
"type": "Manifest",
"behavior": [
"individuals",
"no-auto-advance"
],
"viewingDirection": "left-to-right",
"label": {
{
"@context": [
"http://iiif.io/api/presentation/2/context.json",
"http://wellcomelibrary.org/ld/ixif/0/context.json"
],
"@id": "https://wellcomelibrary.org/iiif/b17307703/manifest",
"@type": "sc:Manifest",
"label": "I remember: Sir Henry Dale.",
"metadata": [
{
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/ginco/ginco/ginco-cli/target/lib/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/ginco/ginco/ginco-cli/target/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2017-10-11 11:41:59,067 INFO | main | o.s.context.support.ClassPathXmlApplicationContext | Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@65e2dbf3: startup date [Wed Oct 11 11:41:59 CEST 2017]; root of context hierarchy
2017-10-11 11:41:59,095 INFO | main | o.s.beans.factory.xml.XmlBeanDefinitionReader | Loading XML bean definitions from class path resource [applicationContext-cli.xml]
2017-10-11 11:41:59,336 INFO | main | o.s.beans.factory.config.PropertyPlacehold
@jajm
jajm / app.psgi
Last active April 20, 2024 22:11
Koha / Starman / Nginx
# /home/koha/app.psgi
use Modern::Perl;
use Plack::Builder;
use Plack::App::CGIBin;
use Plack::App::Directory;
use Plack::App::URLMap;
use Mojo::Server::PSGI;
// ==UserScript==
// @name hide obs bz
// @author Jonathan Druart <[email protected]>
// @namespace http://bugs.koha-community.org
// @description Hide obsolete patches on Bugzilla
// @license the beer-ware license
// @grant none
// @require http://code.jquery.com/jquery-1.8.3.min.js
// @include https://bugs.koha-community.org/*
// ==/UserScript==
@jajm
jajm / git-bz-rebase
Last active March 1, 2021 12:42
git-bz-rebase
#!/bin/sh
usage="Usage: git bz-rebase BUG_NUMBER"
if [ -z "$1" ]; then
echo "$usage" && exit 1
fi
if [ ! -x "$(which pup)" ]; then
echo "pup is required for this to work"
@jajm
jajm / caltool.pl
Last active January 29, 2016 13:49
caltool.pl
#!/usr/bin/perl
use Modern::Perl;
use DateTime;
use Date::Calc qw/Monday_of_Week This_Year Add_Delta_Days/;
use FindBin qw/$Bin/;
use Data::Dumper;
my $weekno = $ARGV[0] or die "give a week number!";
my $year = (@ARGV > 1) ? $ARGV[1] : This_Year();