Skip to content

Instantly share code, notes, and snippets.

@sago35
sago35 / 11_oled_animation.go
Created July 29, 2024 13:59
Animation / TinyGo / SSD1306
package main
import (
"image/color"
"machine"
"time"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/ssd1306"
"tinygo.org/x/tinyfont"
@sago35
sago35 / WRC Switch
Last active March 11, 2024 00:02
WRC Switch - EA SPORTS™ WRC
javascript:(function(){var currentUrl=window.location.href.split("?")[0];if(currentUrl.startsWith("https://wrcbuddy.com/static-leaderboard")){var parts=currentUrl.split("/");var selectedLocation=parts[4];var selectedRoute=parts[5];var selectedVehicleClass=parts[6];var selectedSurfaceCondition=parts[7];var racenetUrl="https://racenet.com/ea_sports_wrc/leaderboards/?selectedLocation="+selectedLocation+"&selectedRoute="+selectedRoute+"&selectedSurfaceCondition="+selectedSurfaceCondition+"&selectedVehicleClass="+selectedVehicleClass+"&slot=secondary";window.location.href=racenetUrl;}else if(currentUrl.startsWith("https://racenet.com/ea_sports_wrc/leaderboards")){var params=new URLSearchParams(window.location.search);var selectedLocation=params.get('selectedLocation');var selectedRoute=params.get('selectedRoute');var selectedVehicleClass=params.get('selectedVehicleClass');var selectedSurfaceCondition=params.get('selectedSurfaceCondition');var wrcbuddyUrl="https://wrcbuddy.com/static-leaderboard/"+selectedLocation+
@sago35
sago35 / git-log-pretty-cheatsheet.pl
Created March 4, 2024 23:45
git-log-pretty-cheatsheet
#!/usr/bin/env perl
# 以下の Perl version として作成
# git-logのPRETTY FORMATの動くチートシートを作った
# https://zenn.dev/fujimura/articles/79b27b80e14e2e
use strict;
use warnings;
my $CLEAR = "\e[0m";
@sago35
sago35 / open-with-kicanvas
Created January 5, 2024 00:32
[bookmarklet] open with kicanvas
javascript:(function() {
var githubUrl = window.location.href;
var encodedUrl = encodeURIComponent(githubUrl);
window.location.href = 'https://kicanvas.org/?github=' + encodedUrl;
})();
@sago35
sago35 / Dockerfile
Last active June 29, 2024 09:31
Dockerfile for vial-web
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y tzdata
# timezone setting
ENV TZ=Asia/Tokyo
RUN apt-get update && apt-get install -y \
git \
bash \
@sago35
sago35 / tinygo-encoding-json.go
Created March 25, 2023 06:00
tinygo with encoding/json
package main
import (
"encoding/json"
"fmt"
"log"
)
func main() {
err := run()
@sago35
sago35 / usb_interrupt_out.go
Created January 18, 2023 00:36
USB HID Interrupt Out
package main
import (
"fmt"
"log"
"time"
"github.com/DarkMetalMouse/hid"
)
@sago35
sago35 / main.go
Created December 24, 2022 02:00
net/http server (chunked)
package main
import (
"io"
"log"
"net/http"
)
func main() {
err := run()
@sago35
sago35 / errors.go
Created May 17, 2022 11:52
TinyGo : fmt package for debugging the machine package
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fmt
import "errors"
// Errorf formats according to a format specifier and returns the string as a
// value that satisfies error.
@sago35
sago35 / main.go
Created March 29, 2022 08:32
tinygo + bitmap
package main
import (
"fmt"
"image/color"
"strings"
"time"
"golang.org/x/image/bmp"