Skip to content

Instantly share code, notes, and snippets.

View lestrrat's full-sized avatar

lestrrat lestrrat

View GitHub Profile

Quid pro quo

If you use this software to build products in a for-profit organization, we ask you to follow the guidelines below. This is NOT a licensing term: it's only a plea for people to acknowledge the work from FOSS developers whose work you rely on each and everyday. The following does NOT apply to individuals, non-profit organizations, and for-profit organizations with fewer than 100 employees.

  • For every 100 employees (direct hires) of your organization, please contribute minimum of $5 every year to either this project, or FOSS projects that this project uses. For example, for 100 employees, we ask you contribute $500 yearly; for 10,000 employees, we ask you contribute $50000 yearly.
  • If possible, please make this information public. You do not need to disclose the amount you are contributing, but please make the information that you are contributing to particular FOSS projects public.

I unexpectedly had to quit my previous job and am now in search of a new one. If you are interested in hiring me or have leads, I would very much appreciate it if you could contact me at my ID + gmail.

Past experiences

https://lestrrat.github.io/

During 2000-2019, I worked as a backend software engineer, writing anything from small tools to servers handling billions of requests. Now I focus on writing software with Go. During 2019-2024, I worked as TechPR, acting to promote my employer to the outside engineering community, as well as enabling and otherwise making internal engineers happier. I still wrote code for FOSS, but not for a living.

I have 15+ years experience writing about programming in commercial publishing.

// https://github.com/lestrrat-go/jwx/blob/129e8b1d3bc86038ded5b41e8720b120194074f8/examples/jwk_parse_key_example_test.go
package examples_test
import (
"encoding/json"
"fmt"
"os"
"github.com/lestrrat-go/jwx/v2/jwk"
)
// https://github.com/lestrrat-go/jwx/blob/129e8b1d3bc86038ded5b41e8720b120194074f8/examples/jwt_builder_example_test.go
package examples_test
import (
"encoding/json"
"fmt"
"os"
"github.com/lestrrat-go/jwx/v2/jwt"
)
package examples_test
import (
"fmt"
"net/http"
"net/url"
"strings"
"github.com/lestrrat-go/jwx/v2/jwt"
)
@lestrrat
lestrrat / ripple.pl
Last active September 27, 2021 05:09
"Ripple" shift the contents of an SBV file
#!perl
# perl ripple.pl $ref $delta file.sbv
use strict;
use POSIX qw(floor);
# $ref is the time code (in seconds) where the ripple should start
my $ref = shift @ARGV;
lestrrat@finch bench % benchstat -sort -delta stdlib.txt v0.4.2.txt
name old time/op new time/op delta
JWK/Serialization/RSA/PrivateKey/jwk.Parse-8 50.0µs ± 1% 15.8µs ± 8% -68.40% (p=0.008 n=5+5)
JWK/Serialization/RSA/PrivateKey/jwk.ParseString-8 50.4µs ± 1% 18.5µs ±15% -63.23% (p=0.008 n=5+5)
JWK/Serialization/EC/PrivateKey/jwk.Parse-8 15.6µs ± 1% 5.8µs ± 5% -63.11% (p=0.008 n=5+5)
JWK/Serialization/EC/PrivateKey/jwk.ParseString-8 15.9µs ± 3% 5.9µs ± 2% -62.64% (p=0.008 n=5+5)
JWK/Serialization/RSA/PrivateKey/jwk.ParseReader-8 50.9µs ± 1% 19.2µs ± 6% -62.31% (p=0.008 n=5+5)
JWK/Serialization/EC/PrivateKey/jwk.ParseReader-8 15.7µs ± 1% 6.0µs ± 4% -61.50% (p=0.008 n=5+5)
JWS/Serialization/JSON/jws.Parse-8 21.1µs ± 1% 8.3µs ± 2% -60.65% (p=0.008 n=5+5)
JWS/Serialization/JSON/jws.ParseString-8 21.3µs ± 2%
@lestrrat
lestrrat / translation2srt.pl
Last active November 17, 2020 23:23
開始時間/終了時間/英語/日本語 の4つのカラムのTSVファイルから、日本語訳文をSRTファイル形式に整形するツール。1行目にヘッダがある想定。使い方はコメントの中に。
#
# Preparation:
#
# 1. Install perl5, cpanm
# 2. cpanm -L local -n Text::CSV_XS
#
# Execution:
#
# perl script.pl source.tsv
#
@lestrrat
lestrrat / rename.pl
Created December 20, 2019 00:44
卒園式のDVD作るのに特定の命名規則に沿った写真ファイルを送ってこいって指令があったので…
use strict;
use lib "local/lib/perl5";
use Data::Dumper;
use Image::ExifTool qw(:Public);
use Time::Piece;
my $name = "___CHILD'S_NAME___";
my @files;
for my $file (glob("*.jpg")) {
#!/bin/bash
# Installs mariadb in Debian 9 GCP VM, creates self-signed certificates,
# sets up the server config, and restarts the mysql server
set -e
set -x
apt-get update
apt-get install -y mysql-server