Skip to content

Instantly share code, notes, and snippets.

View gxjakkap's full-sized avatar
💫

Jakkaphat Chalermphanaphan gxjakkap

💫
View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
if [ "$(basename "$PWD")" != "oph2025" ]; then
echo "You are not in oph2025"
exit 1
fi
mkdir -p ~/.oph-tmp
apt update
apt install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
@gxjakkap
gxjakkap / pkm.py
Last active December 6, 2024 17:05
def pkm():
h = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
cur = input() # get input. e.g.: e4
cur = list(cur) # split each character to list. e.g. [e, 4]
curInt = [h.index(cur[0].upper()) + 1, int(cur[1])] # change horizontal axis to int (+1 since index is 0 based)
allPossibleMove = []
# two horizontal + one vertical
for i in [2, -2]:
x = curInt[0] + i # get horizontal axis move
@gxjakkap
gxjakkap / cleanVlr.user.js
Last active September 26, 2024 17:04
remove most of vlr.gg ads and betting section. (betting link (not ads) can be enabled by setting showBetting to true)
// ==UserScript==
// @name cleanVlr
// @version 1.1
// @grant none
// @match *://*.vlr.gg/*
// ==/UserScript==
const showBetting = false;
document.getElementById("float-left-300").remove()
@gxjakkap
gxjakkap / fptscript.gs
Created November 28, 2022 17:28
script ที่ใช้ทำเรื่องเสื้อสี (format ข้อความแจ้งคนยังไม่จ่ายเงิน/แจ้งคนมารับเสื้อแล้ว)
function printScrooge() {
const sheet = SpreadsheetApp.openById('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
const res = sheet.getSheetByName('Res')
const slip = sheet.getSheetByName('Slip')
const all = res.getDataRange().getValues()
const payed = slip.getDataRange().getValues()
let c = 0
let arr = []
for (i=1; i < all.length; i++){