Skip to content

Instantly share code, notes, and snippets.

View patch's full-sized avatar

Nova Patch patch

View GitHub Profile
@patch
patch / confusable-country-language-codes.txt
Last active December 10, 2022 19:08
Confusable country vs. language codes, generated from CLDR data, with strongly associated country/language pairs removed (e.g. DE)
AE: United Arab Emirates or Avestan?
AF: Afghanistan or Afrikaans?
AM: Armenia or Amharic?
AR: Argentina or Arabic?
AS: American Samoa or Assamese?
BA: Bosnia & Herzegovina or Bashkir?
BE: Belgium or Belarusian?
BI: Burundi or Bislama?
BM: Bermuda or Bambara?
BN: Brunei or Bangla?
@patch
patch / perl6_one_liners
Last active October 27, 2017 14:05 — forked from djhworld/haskell_one_liners
Perl 6 One Liners
-- Inspired by http://solog.co/47/10-scala-one-liners-to-impress-your-friends/
# Double everything in a list
(1..10).map(* * 2)
# Sum a list of numbers
(1..1000).sum
# TODO: Verify if exists in a string
#any (`elem` ["haskell", "ghc", "monads", "cabal"]) $ words "this is a piece of example text talking about haskell and ghc"
@patch
patch / perl6-one-liners.sh
Last active October 4, 2017 19:26
perl6 one-liners
# count the elements in a json file
perl6 -MJSON::Tiny -e 'say from-json(lines).elems' file.json
@patch
patch / gist:04c3e8ad885062e1f479
Created August 27, 2014 19:11
PHP localized date/time
$date_fmt = new IntlDateFormatter(
'pt-BR',
IntlDateFormatter::SHORT,
IntlDateFormatter::SHORT,
'America/New_York',
IntlDateFormatter::GREGORIAN,
);
# $date may be DateTime object, IntlCalendar object, seconds since epoch, or localtime array
$formatted = $date_fmt->format($date);
conference location start end deadline website
Perl Oasis West Tampa, FL, US 2014-01-25 2014-01-25 2014-01-20 http://perloasis.info
Perl QA Hackathon Lyon, FR 2014-03-13 2014-03-16 http://2014.qa-hackathon.org
German Perl Workshop Hannover, DE 2014-03-26 2014-03-28 http://act.yapc.eu/gpw2014
Dutch Perl Workshop Utrech, NL 2014-04-35 2014-04-35 http://perlworkshop.nl
Polish Perl Workshop Poznań, PL 2014-05-16 2014-05-18 http://act.yapc.eu/plpw2014
Czech Perl Workshop Prague, CZ 2014-05-20 2014-05-21 http://act.yapc.eu/czpw2014
YAPC::
@patch
patch / gist:8611350
Last active January 4, 2016 10:49
NYBG Botany classes

Botany

Core

▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦▦ 27

▨▨▨▨▨▨▨▨▨ 9

▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥▥ 78

@patch
patch / gist:7419410
Last active December 28, 2015 01:19

Comment on Mojolicious Unicode Normalization Plugin Released by chromatic at Modern Perl Programming (since the local comments are broken):

Nice! In the past I was looking at writing a PerlIO layer for implicit Unicode normalization on I/O. ikegami has worked on writing PerlIO::via::Normalize but it's been on GitHub for two years without a CPAN release.

Although I definitely have a need for normalization forms other than NFC, I use NFC for general input normalization and then explicitly normalize to another form on the rarer cases when I need them, such as some text indexing and information retrieval (NFKC) as well as some regexes (NFD).

Have you thought about the option to normalize on output? There are two reasons that this can be desired: 1) applications with public-facing APIs should always output data in NFC, but some people, such as tchrist, wan

@patch
patch / gist:7013741
Last active December 25, 2015 17:29
escape sequences
language 2-hex 4-hex n-hex non-BMP 3-oct n-oct ctrl name seq
C# - \u03C0 \x3C0 \U0001F4A9 \241 - \cD - -
Go \xF1 \u03C0 - \U0001F4A9 \241 - - - -
ICU \xF1 \u03C0 \x{3C0} \U0001F4A9 \0241 - \cD \N{ARABIC KASRA} -
Java \xF1 \u03C0 \x{3C0} \x{1F4A9} \0241 - \cD - -
JavaScript \xF1 \u03C0 - \uD83D\uDCA9 \241 - \cD - -
JSON - \u03C0 - \uD83D\uDCA9 - - -
@patch
patch / gist:6160525
Created August 5, 2013 23:17
plant identification books

Recommended books for learning plant identification in the Northeastern United States.

  1. Newcomb’s Wildflower Guide by Lawrence Newcomb
  2. Botany in a Day: The Patterns Method of Plant Identification by Thomas J. Elpel
  3. Weeds of the Northeast by Richard H. Uva, Joseph C. Neal, & Joseph M. DiTomaso
  4. Wild Urban Plants of the Northeast: A Field Guide by Peter Del Tredici
  5. A Field Guide to Edible Wild Plants: Eastern and Central North America by Lee Allen Peterson
@patch
patch / gist:5759673
Last active August 18, 2022 17:16
3-letter words not in Unicode character names
# @mjdominus Interesting puzzle: Find a three-letter English word that does not occur as a substring of the name of any Unicode character.
# https://twitter.com/mjdominus/status/344513834205184001
$ wget http://www.yak.net/kablooey/scrabble/3letterwords.html
$ wget http://www.unicode.org/Public/UCD/latest/ucd/NamesList.txt
$ wget http://www.unicode.org/Public/UCD/latest/ucd/NameAliases.txt
$ wget http://www.itscj.ipsj.or.jp/sc2/open/02n4268/HangulSy.txt
perl -MFile::Slurp -E'$d = join "", map {read_file "$_.txt"} qw/NamesList NameAliases HangulSy/; say lc join " ", grep {$_ && $d !~ /$_/} map {m|<B>(.{3})</B>|; $1} <>' 3letterwords.html
adz awl azo biz brr buy caw coy coz cue cwm daw due dui eau efs elk ems fag fas few fey fez fib fid fiz fob foe foh foy fry fub fud fug gey gnu goy guv guy gym hew hmm ids ivy jaw jew jow kea kif luv maw mew mho mow myc naw oho ohs ooh orb oxo oxy pew pht pry qis raj reb rye sew sky sly spy sri tew toy tsk tui vau vaw veg vig voe vug vum why wiz wog wok wos wot wow wud wye yow