Skip to content

Instantly share code, notes, and snippets.

View ushitora-anqou's full-sized avatar
🤪
Lots of fun

Ryotaro Banno ushitora-anqou

🤪
Lots of fun
View GitHub Profile
17a18
> #include "compat.h"
42c43
< char *filename;
---
> const char *filename;
158c159
< memcpy(String_val(tmp), buf + rowbytes * i, rowbytes);
---
> memcpy(Bytes_val(tmp), buf + rowbytes * i, rowbytes);
#!/usr/bin/bash -xeu
set -o pipefail
DOMAIN=mstdn.anqou.net
ACCESS_TOKEN=
list-domains(){
curl -H "Authorization: Bearer ${ACCESS_TOKEN}" https://${DOMAIN}/api/v1/notifications | \
jq -r '.[].account.acct' | \
#!/usr/bin/bash
if [ $(basename "$1") = "io_k8s_apiextensions_apiserver_pkg_apis_apiextensions_v1_json_schema_props.ml" ]; then
sed -i "s/Io_k8s_apiextensions_apiserver_pkg_apis_apiextensions_v1_json_schema_props.//g" "$1"
fi
# OCAML_POST_PROCESS_FILE="$PWD/postprocess.sh" java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.29/api/openapi-spec/swagger.json -g ocaml -o out/ocaml --enable-post-process-file
@ushitora-anqou
ushitora-anqou / deploy.yaml
Created September 28, 2023 11:53
Qash deploy workflow
name: Deploy
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
@ushitora-anqou
ushitora-anqou / calendar2todoist.gs
Last active November 1, 2022 02:24
Transfer plans in Google calendar to Todoist
const CALENDAR_IDS = ["カレンダー連携ID"];
const TODOIST_TOKEN = "Todoistトークン";
const TODOIST_PROJECT_ID = "Todoist追加先プロジェクトID";
function pad02(s) {
return ("0" + s).slice(-2);
}
function createTodoistTasks(todoistToken, todoistProjectId, tasks, dateForAllDayTask) {
for (let task of tasks) {
@ushitora-anqou
ushitora-anqou / slide4to1.sh
Created December 23, 2021 09:13
Split 4-slide pages into separate ones
#!/usr/bin/bash
#
# 0 -1 -348
# -->|
# ----------------------->|
#
# +----------+ +----------+
# | | | |
# | SLIDE #1 | | SLIDE #2 |
@ushitora-anqou
ushitora-anqou / beamer_fukidashi.tex
Last active October 19, 2021 09:08
LaTeX Beamer callouts
\documentclass[dvipdfmx]{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts,tikzmark,calc}
% Usage: \COLabel{name#1}{text#2}
% e.g.: \COLabel{psi1}{$\psi_1$}
\newcommand{\COLabel}[2]{%
\tikz[%
remember picture,%
baseline=(#1.base),%
+-------+-------+-------+--------+-------+-------+-------+-------+-------+-------+-----------------+------------------------------------------------------------------------------------------------------+
| COUNT | MIN | MAX | SUM | AVG | P1 | P50 | P99 | STD | K | CALLTRACE | DESC |
+-------+-------+-------+--------+-------+-------+-------+-------+-------+-------+-----------------+------------------------------------------------------------------------------------------------------+
| 6137 | 0.001 | 0.236 | 45.004 | 0.007 | 0.001 | 0.006 | 0.026 | 0.006 | Qu | main.go:1482 | SELECT `teams`.`id` AS `id`, `teams`.`name` AS `name`, `teams`.`leader_id` AS |
| | | | | | | | | | | | `leader_id`, `teams`.`withdrawn` AS `withdrawn`, `team_student_flags`.`student` |
|
@ushitora-anqou
ushitora-anqou / getlinuxinfo.sh
Last active May 28, 2020 15:27
Get all info about the machine.
#!/bin/bash
function failwith() {
echo -e "\e[37;41;1m[ERROR] $1\e[m" >&2
exit 1
}
[ $# -eq 1 ] || failwith "Usage: $0 OUTPUT-DIRECTORY"
( whoami | grep -E '^root$' 2>&1 > /dev/null ) || failwith "Run by root"
#!/usr/bin/ruby
require "base64"
require "optparse"
params = {
from: nil,
to: [],
subject: "",
message: nil,