This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Take-home coding exercise answer for Pete Evstratov: | |
// | |
// The original code had multiple issues that have been addressed in this version: | |
// | |
// 1. Original question on why the script runs slow: because the code was searching for address and | |
// employee information on each iteration of a loop leading to an O(2n^2) algo. | |
// I changed the code to use two maps instead to look up that info, before we start iterating to | |
// construct the email. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($fg) { | |
$foreground = ($bb ? 'bright_' : '') . $fg; | |
# use Acme::Dump::And::Dumper; | |
# warn DnD [ $foreground ]; | |
if ($foreground =~ /^rgb/) { | |
# %RGB_MAP | |
my ($r, $g, $b) = $foreground =~ /(\d)(\d)(\d)/; | |
$r = 255*$r/5; $r = 255 if $r > 255; $r = 0 if $r < 0; | |
$g = 255*$g/5; $g = 255 if $g > 255; $g = 0 if $g < 0; | |
$b = 255*$b/5; $b = 255 if $b > 255; $b = 0 if $b < 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
package Color::RGB::Util; | |
our $DATE = '2019-08-20'; # DATE | |
our $VERSION = '0.599'; # VERSION | |
use 5.010001; | |
use strict; | |
use warnings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
#!/usr/bin/env perl | |
# vim: set ts=2 sts=2 sw=2 expandtab smarttab: | |
# | |
# This file is part of Parse-ANSIColor-Tiny | |
# | |
# This software is copyright (c) 2011 by Randy Stauner. | |
# | |
# This is free software; you can redistribute it and/or modify it under |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if[^{]+(?<!\!)=(?!=)[^{]+\{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ErrorLog ${APACHE_LOG_DIR}/error.<REDACTED>.ca.log | |
ServerName <REDACTED>.ca | |
ServerAlias www.<REDACTED>.ca | |
<Proxy *> | |
Require all granted | |
</Proxy> | |
ProxyRequests Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias bump-it='rm -fr nqp && | |
git clone https://github.com/perl6/nqp/ && | |
cd nqp && | |
git clone https://github.com/MoarVM/MoarVM/ && | |
cd MoarVM && | |
git describe > ../tools/build/MOAR_REVISION && | |
cd ../ && | |
git commit -m '\''Bump MoarVM'\'' tools/build/MOAR_REVISION && | |
git describe > ../tools/build/NQP_REVISION && | |
cd ../ && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just some setup for the files we'll be reading: | |
'file1'.IO.spurt: "a\nb\nc"; | |
'file2'.IO.spurt: "d\ne\n"; | |
'file3'.IO.spurt: "f"; | |
my $line; | |
# CatHandle accepts any mix of Cool:D, IO::Path, IO::Handle, IO::Pipe: | |
my $kitty = IO::CatHandle.new: 'file1', 'file2'.IO, 'file3'.IO.open, | |
:on-switch{ $line = 1 }; # define what to do on handle switch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t/spec/S02-types/baghash.rakudo.moar (Wstat: 256 Tests: 265 Failed: 1) | |
Failed test: 250 | |
Non-zero exit status: 1 | |
t/spec/S02-types/mixhash.rakudo.moar (Wstat: 256 Tests: 236 Failed: 1) | |
Failed test: 219 | |
Non-zero exit status: 1 | |
t/spec/S06-signature/types.t (Wstat: 512 Tests: 18 Failed: 2) | |
Failed tests: 11-12 | |
Non-zero exit status: 2 | |
t/spec/S32-exceptions/misc.rakudo.moar (Wstat: 1536 Tests: 427 Failed: 6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias perl6repl='perl6 -e '\'' | |
use nqp; | |
sub MAIN (*%adverbs) { | |
REPL.^mixin( | |
role { | |
has IO::Path $!history-file; | |
method history-file (--> Str:D) { | |
return $!history-file.absolute if $!history-file.defined; | |
$!history-file = $*ENV<RAKUDO_HIST> |
NewerOlder