Skip to content

Instantly share code, notes, and snippets.

View rekyuu's full-sized avatar
🏳️‍🌈
everyday it's fresh bread

rekyuu rekyuu

🏳️‍🌈
everyday it's fresh bread
View GitHub Profile
@rekyuu
rekyuu / screenshot-grim.sh
Created May 30, 2023 00:36
screenshot-grim.sh
#! /bin/bash
function get-sway-window-id() {
swaymsg -t get_tree | jq ".. | select(.type?) | select(.pid==$1).id"
}
function slurp-custom() {
slurp -b "#00000075" -c "#FF0000FF"
}
@rekyuu
rekyuu / .zshrc
Created January 29, 2023 08:24
.zshrc
# ~/.zshrc
# Exports
. ~/.zprofile
# Keybinds
@rekyuu
rekyuu / Program.cs
Last active October 30, 2022 09:00
Genshin Impact - Retrieve Gacha API URL
// See https://aka.ms/new-console-template for more information
using System.Collections.Specialized;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
string homeFolder = "/home/rekyuu";
string genshinPrefix = $"{homeFolder}/wineprefixes/genshin-impact";
@rekyuu
rekyuu / update-dns-ip.sh
Created June 6, 2022 17:07
CloudFlare non-static (dynamic) DNS update script
#! /bin/bash
DNS_NAME=""
ZONE_ID=""
API_TOKEN=""
DNS_RECORD_ID=""
log-to-file() {
TIMESTAMP=$(TZ="America/Boise" date --iso-8601="seconds")
echo "[$TIMESTAMP] $1" >> update-dns-ip.log
using Godot;
public class Player : KinematicBody
{
[Export] public float Speed = 7.0f;
[Export] public float JumpStrength = 20.0f;
[Export] public float Gravity = 50.0f;
private Vector3 _velocity = Vector3.Zero;
private Vector3 _snapVector = Vector3.Down;
@rekyuu
rekyuu / UpgradeMediaWiki.md
Created November 14, 2021 05:38
How to upgrade MediaWiki for the forgetful (me)
  1. Backup the wiki

    $ cp -R /srv/http/my-wiki /srv/http/beta-my-wiki
  2. Extract the new MediaWiki over the new site

    $ tar xf mediawiki-1.36.2.tar.gz
@rekyuu
rekyuu / Dockerfile
Created November 11, 2021 03:50
TeamCity Agent with Docker 20
FROM jetbrains/teamcity-agent:2021.2-linux-sudo
ARG dockerLinuxComponentVersion='5:20.10.10~3-0~ubuntu'
USER root
RUN apt-get update && \
apt-get install -y docker-ce=${dockerLinuxComponentVersion}-$(lsb_release -cs) \
docker-ce-cli=${dockerLinuxComponentVersion}-$(lsb_release -cs)
@rekyuu
rekyuu / chika.sh
Last active October 20, 2020 10:30
Livestreaming Script
#!/bin/sh
# Usage: $ sh chika.sh -v TARGET_PATH [-i] [-t START_TIME] [-e EPISODE_NO] [-a AUDIO_TRACK] [-s SUBTITLE_TRACK] [-f]
# -v TARGET_PATH: Direct path to target file or directory to stream from.
# -i: Provide info about the file.
# -d: Run in debug mode, which prevents the stream from running and the playlist from being deleted.
# -t START_TIME: Start from specified time (as HH:MM:SS.MS).
# -e EPISODE_NO: Start from an episode number when a directory is provided.
# -a AUDIO_TRACK: Specify an audio track to use.
# -s SUBTITLE_TRACK: Use subs embedded in the video file. Optionally specify which subtitle track to use.
using System;
namespace sandbox
{
class Program
{
static void Main(string[] args)
{
// Get the user input for both fractions.
Console.WriteLine("Specify the first fraction.");
@rekyuu
rekyuu / erlangc.exs
Created September 18, 2018 15:31
Elixir ErlangC
defmodule ErlangC do
def factorial_of(0), do: 1
def factorial_of(n) when n > 0, do: n * factorial_of(n - 1)
def traffic_intensity(calls, reporting_period, average_handle_time) do
calls_per_hour = (60 / reporting_period) * calls
(calls_per_hour * (average_handle_time / 60)) / 60
end
def probability_call_waits(traffic_intensity, agents) do