Skip to content

Instantly share code, notes, and snippets.

On holiday

John Barrett jbarrett

Block or report user

Report or block jbarrett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jbarrett /
Last active Mar 30, 2019
Perl weekly challenge 1

As published on
Submissions demonstrated here using Reply.

Write a script to replace the character ‘e’ with ‘E’ in the string ‘Perl Weekly Challenge’. Also print the number of times the character ‘e’ is found in the string.

I didn't write a script so I fail this challenge already.

0> my $foo = 'Perl Weekly Challenge'
$res[0] = "Perl Weekly Challenge"
jbarrett / git-cpr
Created Feb 22, 2019
Git command : checkout PR
View git-cpr
#!/usr/bin/env bash
[ -z "$1" ] && echo PR number required. && exit 1
[ ! -z "$2" ] && BRANCHNAME=$2
git fetch origin pull/$1/head:$BRANCHNAME
git checkout $BRANCHNAME
jbarrett /
Created Dec 18, 2018
Very quick and dirty NTFS file renamer since ntfs-3g will happily write "invalid" filenames.
#!/usr/bin/env perl
use strict;
use warnings;
use File::Copy qw/ mv /;
use File::Find ();
my $dir = $ARGV[0] || '.';
use vars qw/*name *dir *prune/;
jbarrett / reclaimWindows10.ps1
Created Aug 30, 2017 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of (different …
View reclaimWindows10.ps1
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <>
# Modified by: alirobe <> based on my personal preferences.
# Version: 2.6.1, 2017-08-02
# Primary Author Source:
# Tweaked Source:
# Tweak difference:
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
jbarrett /
Last active Aug 31, 2016
Dump Amiga Disk Format (ADF) disk label (-ish, sometimes).
#!/usr/bin/env perl
use strict;
use warnings;
use bytes;
use Carp;
my $filename = $ARGV[0] or croak "usage: $0 <ADF filename>";
-f $filename or croak "File does not exist: $filename";
jbarrett /
Last active Jul 16, 2016
SimCity 3000 Widescreen hack - run from same dir as SC3.EXE / SC3U.EXE
#!/usr/bin/env perl
use strict;
use warnings;
use bytes;
use Carp;
use File::Copy qw/ cp /;
# See:
jbarrett /
Created Jan 20, 2016
What were my request headers?
# plackup
use strict;
use warnings;
use Plack::Request;
use JSON;
my $app = sub {
my $req = Plack::Request->new(shift);
jbarrett /
Created Apr 14, 2015
Dancer2::Plugin::RootURIFor prototype
package Dancer2::Plugin::RootURIFor;
use strict;
use warnings;
my $VERSION = 0;
use URI::Escape;
use Dancer2::Plugin;
jbarrett / todo.html
Last active Aug 29, 2015
The cheapest firefox todo list ever - add to bookmarks, set to load in sidebar
View todo.html
<meta http-equiv="refresh" content="10" />
<frameset cols="*">
<frame id="todo" src="todo.txt">
jbarrett / repl.rc
Created Jan 25, 2014
Devel::REPL config / plugins, goes in ~/
View repl.rc
use warnings;
load_plugin qw(
You can’t perform that action at this time.