Skip to content

Instantly share code, notes, and snippets.

View patch's full-sized avatar

Nova Patch patch

View GitHub Profile
@patch
patch / gist:5717017
Last active December 18, 2015 03:19
character differences with lc or uc before ucfirst
# Characters with different values returned from ucfirst if lc is performed first.
# line 1: original character
# line 2: ucfirst
# line 3: lc
# line 4: ucfirst lc
$ perl -C -M'charnames()' -E'say map { "$_ <" . join(", ", map { sprintf "U+%04X %s", ord, charnames::viacode(ord) } split //) . ">\n" } $_, ucfirst, lc, ucfirst lc for grep { ucfirst ne ucfirst lc } map { chr } 0..0x10FFFF'
İ <U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE>
İ <U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE>
i̇ <U+0069 LATIN SMALL LETTER I, U+0307 COMBINING DOT ABOVE>
@patch
patch / gist:5502982
Created May 2, 2013 15:24
Coerce Moose attribute from Num to Math::BigFloat (untested).
use Moose;
use Moose::Util::TypeConstraints;
use Math::BigFloat;
subtype 'BigFloat',
as class_type('Math::BigFloat');
coerce 'BigFloat',
from 'Num',
via { Math::BigFloat->new($_) };
@patch
patch / gist:5470475
Created April 26, 2013 21:09
manually package CPAN distribution à la Module::Build
perl -MModule::Build::Base -E '$b = Module::Build::Base->new(module_name => "Lingua::Stem::UniNE"); $b->make_tarball(("Lingua-Stem-UniNE-0.04") x 2)'
@patch
patch / gist:5287288
Last active December 15, 2015 16:09
YAPC::NA submission and acceptance history
2007: 68 submitted; 58 accepted
2008: 147 submitted; 98 accepted
2009: 134 submitted; 107 accepted
2010: 150 submitted; 135 accepted
2011: 156 submitted; 103 accepted
2012: 184 submitted; 135 accepted
2013: 136 submitted; 87 accepted
@patch
patch / gist:5080174
Created March 4, 2013 05:35
DCBPW 2013 proposal
---
Title: Unicode Regular Expressions
Tags: regex unicode perl5
Language: English
Duration: 20 minutes
Target audience: Any
Abstract: >
Perl’s regular expression engine provides rich features for matching and
parsing Unicode strings. Recent releases of Perl have added powerful new
modifiers, character classes, and other special escape sequences that can be
@patch
patch / gist:5079856
Last active December 14, 2015 11:29
books to read
  1. The Forest Unseen: A Year’s Watch in Nature by David George Haskell
  2. On the Origin of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life by Charles Darwin
  3. Gödel, Escher, Bach: An Eternal Golden Braid by Douglas R. Hofstadter
  4. Taming Text: How to Find, Organize, and Manipulate It by Grant S. Ingersoll, Thomas S. Morton & Andrew L. Farris
  5. Linguistic Fundamentals for Natural Language Processing: 100 Essentials from Morphology and Syntax by Emily M. Bender
  6. Restful Web Services by Leonard Richardson, Sam Ruby & David Heinemeier Hansson
  7. Pro iOS Internationalization and Localization by Tony Person
  8. Modern Perl by chromatic
  9. why’s (poignant) Guide to Ruby by why the lucky stiff
  10. The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto
@patch
patch / gist:5079771
Last active December 14, 2015 11:29
books read in 2013

List of books read so far in 2013:

  1. Desert Solitaire: A Season in the Wilderness by Edward Abbey
  2. Hayduke Lives! by Edward Abbey
  3. Ishmael by Daniel Quinn
  4. The Story of B by Daniel Quinn
  5. My Ishmael by Daniel Quinn
  6. World War Z: An Oral History of the Zombie War by Max Brooks
  7. Winter World: The Ingenuity of Animal Survival by Bernd Heinrich
  8. Summer World: A Season of Bounty by Bernd Heinrich
@patch
patch / gist:4553836
Last active December 11, 2015 05:39
programming language package archives
@patch
patch / parse_xmlish.pl
Created October 29, 2012 16:16
parse key/string pairs in xmlish markup
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dump qw( dump );
# slurp in filehandle as one string
my $input = do { local $/; <DATA> };
my %data;
@patch
patch / gist:3962191
Last active October 12, 2015 03:08
CPAN modules
Acme::Encode::RFC4042
Alien::ICU
Alien::PhoneNumber
App::stem
Bio::DarwinCore (alternately: Bio::DWC, Bio::DwC, Archive::DarwinCore, etc.; extends DublinCore?)
CLDR::Date
CLDR::List
CLDR::Unit
Config::AppleStrings
Data::Walk::Simple