Skip to content

Instantly share code, notes, and snippets.

View LadyAleena's full-sized avatar
🙂
Still getting the hang of using git and GitHub together

Lady Aleena LadyAleena

🙂
Still getting the hang of using git and GitHub together
View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
use List::MoreUtils qw(uniq);
sub get_generations {
my $person = shift;
my $last = pop @generations if $person !~ /mother|father/;
my @generational_people = map("${_}$person", @generations);
@LadyAleena
LadyAleena / Fancy_Sort_Split.pm
Last active July 24, 2020 16:39
A module to return a list sorted by split values
package Fancy::Sort::Split;
use v5.8.8;
use strict;
use warnings FATAL => qw( all );
use Exporter qw(import);
our $VERSION = '1.0';
our @EXPORT_OK = qw(split_sort);
sub split_sort {
sub fancy_open {
my ($filename, $opt) = @_;
my $encoding = $opt->{'encoding'} // 'utf-8';
open my $fh, "<:encoding($encoding)", $filename or die "Can't open $filename. $!";
my @array;
my $before = $opt->{'before'} // "";
my $after = $opt->{'after'} // "";
while ( my $line = <$fh> ) {
package Util::WordFind;
use strict;
use warnings FATAL => qw(all);
use Exporter qw(import);
our @EXPORT_OK = qw(word_find);
use CGI::Carp qw(fatalsToBrowser);
use File::Basename;
use IO::All;
#!/usr/bin/perl
use strict;
use warnings;
use Text::CSV;
use Data::Dumper;
my $csv = Text::CSV->new({
sep_char => '|',
quote_char => undef,
@LadyAleena
LadyAleena / textify.pl
Created May 10, 2020 02:24
LA's textify subroutine
sub textify {
my ($text, $opt) = @_;
my $root_link = base_path('link');
$text =~ s/$root_link\///;
$text =~ s/_/ /g;
$text =~ s/(?<!Rev\s)\b([DMSJ][rsx]|Mrs|Rev)\b(?!\.)/$1./g;
$text =~ s/\s&\s/ &amp; /g;
$text =~ s/\.{3}/&#8230;/g;
$text =~ s/(\w|\b|\s|^)'(\w|\b|\s|$)/$1&#700;$2/g;
$text =~ s/<.+?>//g unless ($opt->{'html'} && $opt->{'html'} =~ /^[ytk1]/);
my $movies_data = movie('data');
my $search;
my @movies;
if ( $title || $year || $media || $genre || $source || $alpha ) {
my @selections;
push @selections, $title if $title;
push @selections, $year if $year;
push @selections, $media if $media;
push @selections, $genre if $genre;
push @selections, $source if $source;
next if $media && $movie->{'media'} ne $media;
next if $genre && !$movie->{'genre'}{$genre};
next if $source && (!$movie->{'source'} || $movie->{'source'} !~ /\b$source(?!ing)/i);
next if $title && lc($movie->{'title'}) !~ /\L$title\E/i;
next if $alpha && first_alpha($movie->{'title'}) ne $alpha;
/*******************************************************************
* Credits go to: (all members in irc.freenode.net ##javascript *
* inimino (complete adjustments) *
* Maggi (lots of troubleshooting help) *
* Typos_King (input on troubleshooting) *
* Mordof (compiling final efforts into this document) *
*******************************************************************/
function load() {
document.getElementById('site_menu').addEventListener('click', list_onclick);
<infobox>
<data source="mother"><label>Mother</label></data>
<data source="father"><label>Father</label></data>
<data source="partners"><label>Partners</label></data>
<group layout="stacked" collapse="closed">
<header>{{{name}}}'s siblings</header>
<data source="sibling 1">
<label>First sibling</label>
<format>{{{sibling 1}}} {{#if: {{{sibling 1 coparent|}}} | by {{{sibling 1 coparent}}} }} {{#if: {{{sibling 1 gender|}}} | ({{#switch: {{{sibling 1 gender}}} | male = brother | female = sister | #default = }})}}</format>