Skip to content

Instantly share code, notes, and snippets.

@karronoli
karronoli / 2022jinbayama_pre.py
Last active August 14, 2022 05:10
JINBASAN TRAIL RACE 20th Long GPX (no warranty)
import gpxpy
import gpxpy.gpx
gpx = gpxpy.gpx.GPX()
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
@karronoli
karronoli / wsl.bash
Created March 28, 2021 09:47
`PASSWORD_STORE_ENABLE_EXTENSIONS=true pass wsl show -c path/to/password` on WSL
clip() {
local sleep_argv0="password store sleep on display $DISPLAY"
pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
echo -n "$1" | clip.exe || die "Error: Could not copy data to the clipboard"
(
( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" )
echo -n | clip.exe
) >/dev/null 2>&1 & disown
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
}
@karronoli
karronoli / Cargo.lock
Last active January 4, 2021 04:00
Read, Eval, Print Barcode
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
dependencies = [
"memchr",
]
@karronoli
karronoli / fetch_test.log
Last active February 22, 2020 13:33
git fetch . feature/hello:master
$ git init /tmp/fetch_test
Initialized empty Git repository in /tmp/fetch_test/.git/
$ pushd /tmp/fetch_test
/tmp/fetch_test ~
$ git commit --allow-empty -m initial
[master (root-commit) 153b70a] initial
$ git checkout -b feature/hello
Switched to a new branch 'feature/hello'
$ git commit --allow-empty -m hello
[feature/hello b8b8f46] hello
@karronoli
karronoli / fetch_test.log
Created February 22, 2020 12:38
git fetch . feature/hello:master
$ git init /tmp/fetch_test
Initialized empty Git repository in /tmp/fetch_test/.git/
$ pushd /tmp/fetch_test
/tmp/fetch_test ~
$ git commit --allow-empty -m initial
[master (root-commit) 128b0b3] initial
$ git checkout -b feature/hello
Switched to a new branch 'feature/hello'
$ git commit --allow-empty -m hello
[feature/hello 94f1307] hello
@karronoli
karronoli / yurex-test.js
Created October 24, 2019 00:51
[WIP] YUREX Test
// https://github.com/WICG/webhid/blob/master/EXPLAINER.md
// Enable chrome://flags/#enable-experimental-web-platform-features
// Bus 020 Device 000: ID 0c45:1010 Sonix Technology Co., Ltd. YUREX
let deviceFilter = { vendorId: 0x0c45, productId: 0x1010 };
let requestParams = { filters: [deviceFilter] };
let initReport = new Uint8Array(8).fill(0xff);
initReport[0] = 0x52;
initReport[1] = 0x0d;
@karronoli
karronoli / Program.fs
Last active December 23, 2018 02:36
dotnet new console -lang F# -o sample && dotnet add package Manatee.Json && dotnet run # source: https://qiita.com/karronoli/items/46f6892999ee253d6396
// for Manatee.Json ver10
open System
open System.IO
open System.Linq
open Manatee.Json
open Manatee.Json.Schema
open Manatee.Json.Serialization
type Item() =
member val Name = "" with get, set
@karronoli
karronoli / webusb.js
Last active December 23, 2018 02:23
npm install @types/w3c-web-usb && tsc -t ES2015 webusb.ts # source: https://qiita.com/karronoli/items/49eb179b9be6d5268950
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
// webusb.ts
var StandardCode;
@karronoli
karronoli / graphic2pbm.pl
Last active July 11, 2018 16:15
Convert SBPL GrapHic operand to pbm image file.
use strict;
use warnings;
use utf8;
use v5.28;
use File::Basename;
if (!@ARGV || $ARGV[0] !~ /\.sbpl$/) {
print qq($^X $0 graphic.sbpl && convert graphic.pbm graphic.png\n);
@karronoli
karronoli / install-ocrb.ps1
Last active May 6, 2018 04:31
Download Access Runtime, Extract OCRB font, Install OCRB font.
Add-Type -AssemblyName System.Drawing
$code = @'
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
public static class FontUtil {
[DllImport("gdi32.dll")]