Skip to content

Instantly share code, notes, and snippets.

@LiosK
LiosK / install_fq_in_mac.sh
Last active December 17, 2023 10:14
Install Perl modules in macOS system Perl without cluttering /usr/local
#!/bin/bash -x
# Install Perl modules in macOS system Perl without cluttering /usr/local
# Prerequisite
xcode-select --install
# Install modules locally, instructing cpanm to build Universal Binaries
sysperl=/usr/bin/perl
curl -L https://cpanmin.us/ | \
ARCHFLAGS='-arch arm64 -arch arm64e -arch x86_64' \
@LiosK
LiosK / dcmvcf2ldif.pl
Created February 28, 2013 13:21
convert docomo vcard format to ldif
#!/usr/bin/perl
# convert docomo vcard format to ldif
use utf8;
use strict;
use warnings;
use Unicode::Normalize;
binmode(STDOUT, ':utf8');
die 'error: no vcard file specified (*.vcf)' if (@ARGV < 1);
@LiosK
LiosK / build.bat
Created December 27, 2010 14:14
runfor -- Runs a command for a given time, kills it after the time is out.
ghc -W -O -threaded --make runfor
@LiosK
LiosK / keepass2keeper.xsl
Created May 4, 2010 02:56
Convert KeePass XML (2.x) format to keeper.txt format.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- convert KeePass XML (2.x) format to 7-column keeper.txt format -->
<xsl:output method="text" encoding="utf-8" />
<xsl:template match="/">
<xsl:apply-templates select="/KeePassFile/Root/Group" />
</xsl:template>
@LiosK
LiosK / extract_pricedb.pl
Created May 4, 2010 02:54
a code snippet to extract pricedb from gzipped gnucash xml file
#!/usr/bin/perl
# extract pricedb from gzipped gnucash xml file
use utf8;
use strict;
use warnings;
use XML::LibXML;
die 'specify gnucash xml file as argument' unless $ARGV[0];
my $doc = XML::LibXML->load_xml(location => $ARGV[0]);
@LiosK
LiosK / fetch_quotes.pl
Created May 4, 2010 02:53
a simple perl script to fetch fund quotes from yahoo finance japan
#!/usr/bin/perl
# fetch fund quotes from yahoo finance japan
use utf8;
use strict;
use warnings;
use XML::LibXML;
use Finance::Quote;
# extract fund symbols from gnucash xml file