Skip to content

Instantly share code, notes, and snippets.

View lukec's full-sized avatar
💭
Avoiding datetimes

Luke Closs lukec

💭
Avoiding datetimes
View GitHub Profile
#!/usr/bin/env perl
# This code uses the CKAN API and the GoogleChart API to generate an image showing the top ministries by # of packages.
# Example: http://chart.apis.google.com/chart?cht=bhg&chs=600x300&chco=FF0000,008000,0000FF,FFFF00,800080&chdl=Natural+Resources+Canada%7CTreasury+Board+Secretariat%7CEngineering+Services&chd=t:100%7C33.3%7C33.3
use strict;
use warnings;
use JSON qw/decode_json/;
use LWP::UserAgent;
use URI::GoogleChart;
Code:
sub put_package {
my $self = shift;
my $name = shift;
my $package = shift;
my $ua = $self->user_agent;
my $url = $self->api_base . '/package';
my $json = JSON->new->utf8(1)->pretty(1)->encode($package);
$json = URI::Escape::uri_escape_utf8($json);
[08:44am] au: au:506| Variance is a wonderful goal of life - Tell them I had a wonderful life!
[08:44am] au: au:305| Useful to us maybe, but how is it wonderful?
[08:44am] au: au:426| Upgrade your brainheap to v2010.04.01 and you might see why.
[08:44am] au: au:415| Unsupportive copy-pasta statements don't help the situation, you know.
[08:44am] au: au:422| Unprocessable analogies void your statement, too.
[08:44am] au: au:401| Unauthentic vocabulary lifted from Magic: The Gathering decks also undermines your credibility.
[08:44am] au: au:307| Temporarily, can we talk about something else for a bit?
[08:44am] au: au:101| Switching to 31337, please come along ...
[08:44am] au: au:503| Service is out and I've no idea how to learn leetspeak!
[08:44am] au: au:303| See our HTTP::Status dictionaries nearby?
Greetings
6 messages
Luke Closs <lukecloss@gmail.com> Mon, Oct 4, 2010 at 8:37 PM
To: clossey@
Hi, I'm Luke Closs.
I saw you on Google Instant during my annual self-google. I'm from
Vancouver too - what are the odds?
I just named my son Jackson. You don't have a son Jackson Clossey do you?
diff --git a/lib/Check/View/Helpers.pm b/lib/Check/View/Helpers.pm
index 3fb000e..d9d2583 100644
--- a/lib/Check/View/Helpers.pm
+++ b/lib/Check/View/Helpers.pm
@@ -171,6 +171,7 @@ sub format_text {
# If Markdown doesn't get to them first, the scrubber
# will pick them up and re-encode them as &gt;
$text =~ s/&gt;/>/g;
+ $text =~ s/`([^`]+)`/my $c = $1; $c =~ s{&lt;}{<}; "`$c`"/egsm;
@lukec
lukec / gist:3154886
Created July 21, 2012 06:44
perl oneliner to find the population of a city.
cpanm WWW::Wikipedia;perl -le '$t=qx(wikipedia "$ARGV[0]");chomp$t;if($t=~s/.+can refer to.+?\n\n//){map{$c=qx(wikipedia "$_");if($c=~/population_total = ([\d,]+)/){print"$_ $1\n"}}split/\*|\n/,$t}' hartsville

Keybase proof

I hereby claim:

  • I am lukec on github.
  • I am lukec (https://keybase.io/lukec) on keybase.
  • I have a public key whose fingerprint is 373E 91BD 72E3 74A4 E7E2 8EE2 3887 450B 503A EA6E

To claim this, I am signing this object:

@lukec
lukec / .tmux.conf
Created July 16, 2015 05:50
Luke's I-just-discovered-tmux-and-made-it-like-screen-but-better
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
set -g status-keys vi
set -g history-limit 10000
#!/usr/bin/env perl
use strict;
use warnings;
use XML::Simple;
# USAGE: cat your-file.kml | perl art-kml-to-csv > your-file.csv
#
# This script reads from standard input and writes to standard output.
# Pipe your file into this script