Skip to content

Instantly share code, notes, and snippets.

cxw42 / apply-file
Last active April 13, 2020 18:32 Model01 Colormap file
# Modified from Model01-sketch/tools/colormap/apply by Gergely Nagy
# (algernon),
# ,
# licensed GPL3.
here="$(cd "$(dirname "$0")" &>/dev/null ; pwd)"
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <colormap filename>"
cxw42 /
Last active June 22, 2019 18:33
Investigating ${^WARNING_BITS} in Perl 5.26.2
package W;
#use Data::Dumper;
use strict;
use 5.014;
sub import {
say "Compile time: ", unpack('b*', ${^WARNING_BITS});
# ${^WARNING_BITS} is only available at compile time per
cxw42 / cpanfile-from-Makefile-PL
Created May 29, 2019 13:59
Creating a cpanfile from dependency information in Makefile.PL
# Make a cpanfile from the dependencies in Makefile.PL.
# Modified from
# by miyagawa
use CPAN::Meta;
use Module::CPANfile;
die "Could not run Makefile.PL"
unless system($^X, 'Makefile.PL') == 0;
cxw42 /
Created May 24, 2019 19:59
cd to the root of a git repo, even from .git or from submodules (bash)
# Edit as noted below, then source this from your .bashrc, or paste it in there. Then
# cdgr
# will move you to the root of the current git repo (if any).
# If you are in a submodule, it will move you to the top of the containing repo.
# Edits:
# - If you are not on Cygwin, remove line 16
# - If you are on Cygwin, change YOUR_USERNAME on line 16 to ... your username ;) .
# This is to map from /cygdrive paths back to Cygwin-native paths.
cxw42 / mathlib.lua
Last active May 31, 2018 02:04 — forked from xeoncross/mathlib.lua
Moved the exports into the `mathlib` package
-- mathlib.lua
Maths extension library for use in Corona SDK by Matthew Webster.
All work derived from referenced sources.
twitter: @horacebury
code exchange:
cxw42 / test_3_45.t
Created April 3, 2018 17:11
Testing XML::Twig on Cygwin 64-bit
use strict;
use warnings;
use Data::Dumper;
use XML::Twig;
use Test::More tests => 16;
is( XML::Twig->new( keep_encoding => 1)->parse( q{<d a='"foo'/>})->sprint, q{<d a="&quot;foo"/>}, "quote in att with keep_encoding");