Skip to content

Instantly share code, notes, and snippets.

View dgl's full-sized avatar

David Leadbeater dgl

View GitHub Profile
@dgl
dgl / waste
Last active March 12, 2024 12:00
https://waste.st (and https://🗑️ .st) uploader
#!/bin/sh
curl -nT "${1:--}" https://🗑️ .st
From d2ed74f548fb33029a1d759c328216c5e6f5ff63 Mon Sep 17 00:00:00 2001
From: David Leadbeater <[email protected]>
Date: Wed, 6 Dec 2023 14:17:25 +1100
Subject: [PATCH] confirm-paste: No prompt for whitespace with bracketed paste
Bracketed paste mode means the program is suggesting it can handle
pastes, so just send the data to it if it is on and enabled. The main
downside of this is there's no prompting for large pastes anymore.
There's also a minor security advantage of this -- currently if using
@dgl
dgl / git-osc8-pager
Last active May 17, 2024 10:34
A git pager that wraps less and links commits using OSC8
#!/usr/bin/env perl
# ©2023 David Leadbeater <https://dgl.cx/0bsd>; SPDX-License-Identifier: 0BSD
#
# A git pager that wraps less and links commits, plus makes hiding things via
# backspace not work. Your terminal and less will need support for "OSC8":
# https://github.com/Alhadis/OSC8-Adoption
=pod # Setup; run these commands:
wget https://gist.github.com/dgl/ef848e75c03c09b0db63a43173ee5662/raw/git-osc8-pager &&
@dgl
dgl / add-reminder.html
Created May 3, 2020 17:51
Pushgateway powered reminders!
<!DOCTYPE html>
<script>
const PUSHGATEWAY = 'http://pushgateway:9091';
class Pushgateway {
constructor(baseUrl, instanceLabels) {
this.baseUrl = baseUrl;
this.instanceLabels = instanceLabels;
}
local hipchat = import "hipchat.jsonnet";
local params = hipchat.defaultParameters;
hipchat.notify({}, params + {
APIURL: "http://my.hipchat.local/",
AuthToken: "xxxx==",
RoomID: 42,
from: "alertmanager",
message: "test",
@dgl
dgl / e7.ipynb
Created April 17, 2019 18:37
Google Location History takeout
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dgl
dgl / gist:252dea1f11064bc6d042
Created November 8, 2014 12:41
IRC pipe thing
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Sys::Hostname;
use IO::Async::Loop;
use Net::Async::IRC;
my $nick = hostname . "-$$";
@dgl
dgl / update
Created August 1, 2014 22:21
Additions to zz.countries.nerd.dk.rbldnsd
mkdir -p rsync/dg
rsync -a rsync://countries-ns.mdc.dk/zone/ rsync
cat rsync/zz.countries.nerd.dk.rbldnsd zz.countries.nerd.dk.rbldnsd.add > \
rsync/dg/zz.countries.nerd.dk.rbldnsd
### Keybase proof
I hereby claim:
* I am dgl on github.
* I am dgl (https://keybase.io/dgl) on keybase.
* I have a public key whose fingerprint is 8EDA D6F5 ADC2 1C86 D1E2 32F3 F2E7 F1A7 E4D4 D21B
To claim this, I am signing this object:
@dgl
dgl / search_cpan.pl
Created October 11, 2011 19:45
acme's search_cpan.pl with threads
#!/usr/bin/perl
use strict;
use threads;
use threads::shared;
use warnings;
use 5.12.0;
use Archive::Peek::Libarchive;
use Parse::CPAN::Packages;
use Path::Class;
use Term::ANSIColor;