This file contains hidden or 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 | |
# Copied and simplified from https://github.com/scottchiefbaker/perl-git-prompt/blob/master/git-prompt.pl | |
use strict; | |
use warnings; | |
use Cwd; | |
my $COLOR_PROMPT = color(7); | |
my $COLOR_DIRTY = color(1); |
This file contains hidden or 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
// golang jwt jwe | |
func jwt2jwe(jwtStr string) string { | |
rec := jose.Recipient{ | |
Algorithm: jose.PBES2_HS256_A128KW, | |
Key: "mypassphrase", | |
PBES2Count: 4096, | |
PBES2Salt: []byte("salt"), | |
} | |
enc, _ := jose.NewEncrypter(jose.A128CBC_HS256, rec, nil) |
This file contains hidden or 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 strict; | |
use warnings; | |
use Data::Dumper; | |
use Term::ANSIColor; | |
{ | |
# args | |
my $action = ''; | |
my @args = map { $_ =~ s!::!/!g; $_ } @ARGV; |
This file contains hidden or 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 strict; | |
use Getopt::Std; | |
sub main { | |
my $rh_args={}; | |
getopts('o:i:',$rh_args); |
This file contains hidden or 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::VersionDir; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use strict; | |
use warnings; | |
my $c = undef; | |
my $app = undef; | |
my $conf = undef; |
This file contains hidden or 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
#!/bin/sh | |
# set the configuration variables below, before running the script | |
# get the solr nightly build download link from https://builds.apache.org/job/Solr-Artifacts-4.x/lastSuccessfulBuild/artifact/solr/package/ | |
JETTY_URL="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.5.v20130815.tar.gz&r=1" | |
JETTY_HOME="/opt/jetty" | |
JAVA='/usr/local/jdk1.7.0_09/bin/java' | |
JETTY_PORT=8085 | |
JETTY_HOST=127.0.0.1 |
This file contains hidden or 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::GoogleCalc; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use Mojo::ByteStream; | |
use Mojo::Loader; | |
use Mojo::JSON 'j'; | |
use Mojo::ByteStream 'b'; | |
use Mojo::UserAgent; |