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
# create user with a disabled password | |
adduser myusername --disabled-password | |
# optionally add them to a group, like sudo | |
# adduser myusername sudo | |
# delete the disabled password | |
passwd -d myusername | |
# force an immediate password set |
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 | |
use Mojo::Base -strict; | |
use Getopt::Long qw(:config gnu_getopt no_auto_abbrev no_ignore_case); | |
use Mojo::Date; | |
use Mojo::URL; | |
use Mojo::UserAgent; | |
use Mojo::Util 'tablify'; |
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
# dispatch to old Mason coderefs-as-api-endpoints | |
# portion of MyApp::Plugin::Legacy::Handlers | |
our ($MyApp, $c, $m, $r, $dbh, %ARGS, $AES_KEY, $errs); | |
sub get_handler { | |
my (undef, $module, $endpoint) = @_; | |
my $handler = $funcs{$module}{$endpoint} || return; | |
# wrap the dhandler to setup globals when invoked |
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
use Mojolicious::Lite; | |
use DBM::Deep; | |
use Mojo::JWT; | |
plugin 'Bcrypt'; | |
plugin 'Minion' => {SQLite => 'minion.db'}; | |
helper users => sub { state $db = DBM::Deep->new('users.db') }; |
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 Mojo::URLQueue; | |
use Mojo::Base 'Mojo::EventEmitter'; | |
use Mojo::UserAgent; | |
has queue => sub { [] }; | |
has ua => sub { Mojo::UserAgent->new(max_redirects => 5) }; | |
has concurrency => 4; |
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
diff --git a/src/util.ts b/src/util.ts | |
index c6e68b3..23e9b93 100644 | |
--- a/src/util.ts | |
+++ b/src/util.ts | |
@@ -130,6 +130,14 @@ export function decodeURIComponentSafe(value: string): string | null { | |
} | |
} | |
+export function defaultObject<Type>(defaultValue: Type): Record<string, Type> { | |
+ return new Proxy({}, { |
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
export function defaultObject(defaultValue) { | |
return new Proxy({}, { | |
get: function(target, name) { | |
return target.hasOwnProperty(name) ? target[name] : defaultValue; | |
}, | |
}); | |
} |
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
package Mojolicious::Plugin::RequestNegotiation; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use Carp (); | |
sub register { | |
my ($plugin, $app, $conf) = @_; | |
$app->helper(sent => \&_sent); | |
$app->helper(when_sent => \&_when_sent); |
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
use Mojo::Base -strict; | |
use Mojo::DOM; | |
my $html = q!<img src='/__swift/themes/admin_default/images/mimeico_blank.gif' valign='middle' style='position: relative; top: -1px;'> <a href='https://paster.reflected.net/get/665cb7a9-0735-47c9-a33e-3cad17d0b730'><strong>prometheus.20200605.yml</strong></a>!; | |
my $dom = Mojo::DOM->new($html); | |
my $anchor = $dom->at('a'); | |
my $href = $anchor->{href}; |
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
When embarking on community moderation and when claiming the authority to mete out judgements, clear policy and procedure is | |
key to keep the moral authority to do so and to protect all of the parties involved. | |
Effective immediately, The Perl Foundation (TPF)'s Community Affairs Team (CAT) will not accept any incoming reports nor issue | |
any rulings until such time as: | |
a) a set of policies can be created to govern it | |
b) that policy is voted on and accepted by the TPF governing board | |
c) the policy, reporting procedure, and CAT board membership are clearly posted on the TPF's main website | |
Once this is done we hope to rebuild a sense of trust within the Perl Community and to act to keep it safe and welcoming. |
NewerOlder