Skip to content

Instantly share code, notes, and snippets.

View mlbright's full-sized avatar

Martin-Louis Bright mlbright

  • Toronto
  • 17:51 (UTC -04:00)
View GitHub Profile
package main
import (
"fmt"
"os"
"os/exec"
"strings"
"unicode"
"mvdan.cc/sh/v3/syntax"
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw{ say };
use Getopt::Long;
my $options = {};
GetOptions( $options, "--directory=s", "--start=s", "--finish=s" );
A BCDEFDG
AH I ECDDF
HDICJ
A BIKFDGLM
NODCAJDC
IHG GDMPQANDG
NOD CAEODQ
AH I HDICRS
EIJD
@mlbright
mlbright / perl-modules.pl
Created May 26, 2018 04:07
List all installed perl modules
#! /usr/bin/perl -l
use strict;
use warnings;
use File::Find;
my %seen;
for my $inc (@INC) {
next unless (-d $inc);
@mlbright
mlbright / filepath-examples.go
Created January 17, 2018 16:40
Compare golang's filepath.Split and filepath.Dir
package main
import (
"fmt"
"path/filepath"
)
func main() {
paths := []string{
"/home/arnie/amelia.jpg",
{
repository(name: "darksky", owner: "mlbright") {
ref(qualifiedName: "refs/heads/master") {
target {
... on Commit {
tree {
id
entries {
oid
name
{
repository(name: "darksky", owner: "mlbright") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
#!/usr/bin/perl
use strict;
use warnings;
my $days = 7;
my $nights = $days - 1;
my $bar = 2;
my $maid = 5;
my $alacarte = 5;
@mlbright
mlbright / search
Last active March 7, 2017 05:02
possible trees
use Mojolicious::Lite;
# Search MetaCPAN for "mojolicious"
get '/' => sub {
my $c = shift;
$c->ua->get(
'api.metacpan.org/v0/module/_search?q=mojolicious' => sub {
my ( $ua, $tx ) = @_;
sleep(3);
$c->app->log->debug(