Skip to content

Instantly share code, notes, and snippets.

View afresh1's full-sized avatar

Andrew Hewus Fresh afresh1

View GitHub Profile
@afresh1
afresh1 / create_github_labels.js
Created June 4, 2016 23:35
Creates "Sane GitHub Labels", paste into the javascript console on the issue page for your project. https://medium.com/@dave_lunny/sane-github-labels-c5d2e6004b63
labels = [
{ "name": "Priority: Low", "color": "#009800" },
{ "name": "Priority: Medium", "color": "#fbca04" },
{ "name": "Priority: High", "color": "#eb6420" },
{ "name": "Priority: Critical", "color": "#e11d21" },
{ "name": "Status: Abandoned", "color": "#000000" },
{ "name": "Status: Accepted", "color": "#009800" },
{ "name": "Status: Available", "color": "#bfe5bf" },
{ "name": "Status: Blocked", "color": "#e11d21" },
{ "name": "Status: Completed", "color": "#006b75" },
@afresh1
afresh1 / reprove.pl
Last active June 29, 2016 14:55
This script watches your tests and your files and re-runs "prove" to help with perl TDD -- http://perldoc.perl.org/prove.html
#!/usr/bin/perl
# Copyright (c) 2015 Andrew Fresh <andrew@afresh1.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@afresh1
afresh1 / c_rehash.sh
Last active September 22, 2016 16:38
This script replaces the c_rehash perl script from openssl, at least the main functionality of it. From http://man.openbsd.org/SSL_CTX_load_verify_locations
#!/bin/sh
# replaces the c_rehash perl script from openssl.
# by afresh1
rm -f *.[0-9]* *.r[0-9]*
for c in *.pem; do
[ "$c" = "*.pem" ] && continue
hash=$(openssl x509 -noout -hash -in "$c")
if egrep -q -- '-BEGIN( X509 | TRUSTED | )CERTIFICATE-' "$c"; then
suf=0
@afresh1
afresh1 / BingQuadkeys.pm
Created October 3, 2013 04:25
Translation of Bing Quadkeys helper functions to perl. Original code at http://msdn.microsoft.com/en-us/library/bb259689.aspx
package BingQuadkeys;
use Exporter qw(import);
use strict;
use warnings;
our @EXPORT_OK = qw(
clip
map_size
ground_resolution
map_scale
@afresh1
afresh1 / sysutils-rclone-Makefile
Created March 10, 2017 17:53
OpenBSD port Makefile for rclone
# $OpenBSD$
COMMENT = rsync for cloud storage
GH_ACCOUNT = ncw
GH_PROJECT = rclone
GH_TAGNAME = v1.35
CATEGORIES = sysutils
use v5.24.0;
use warnings;
use feature 'signatures';
no warnings 'experimental::signatures';
# https://aphyr.com/posts/340-acing-the-technical-interview
sub true() { 1 }
sub false() { 0 }
@afresh1
afresh1 / queue-status.pl
Last active July 22, 2017 22:12 — forked from dlangille/queue-status.pl
Would someone convert this to use File::Find for me please? I wrote this a loooong time ago. Thank you.
#!/usr/bin/perl
#
# $Id: queue-status.pl,v 1.3 2012/10/17 18:10:22 dan Exp $
#
# Copyright (c) 2001-2006 DVL Software
#
use strict;
use warnings;
@afresh1
afresh1 / admin.cgi.patch
Created October 12, 2017 02:29
blogsum as a Plack app
--- admin.cgi.orig Wed Oct 11 18:32:23 2017
+++ admin.cgi Wed Oct 11 18:32:52 2017
@@ -8,19 +8,19 @@
###########################
use strict;
use Blogsum::Config;
-my $database = $Blogsum::Config::database;
-my $blog_theme = $Blogsum::Config::blog_theme;
-my $blog_title = $Blogsum::Config::blog_title;
+our $database = $Blogsum::Config::database;
#!/usr/bin/env plackup
use strict;
use warnings;
use Plack::Builder;
use Plack::App::File;
use Plack::App::WrapCGI;
BEGIN {
chdir "/var/www/blogsum" or die "Unable to chdir: $!";
@afresh1
afresh1 / force_hires_move.pl
Created November 3, 2017 14:39
Forces File::Copy to use HiRes times in move.
#!/usr/bin/perl
use v5.20;;
use warnings;
BEGIN {
require Time::HiRes;
# Has to come before importing File::Copy
Time::HiRes->export( 'File::Copy', qw( stat utime ) );
}
use File::Copy;