Skip to content

Instantly share code, notes, and snippets.

View idoleat's full-sized avatar
🛌
zzZ

C.W. Chien idoleat

🛌
zzZ
View GitHub Profile
@idoleat
idoleat / vb16sort.c
Last active March 21, 2024 12:27
Sort linked list with size at most 16 and limited to numeric element value.
/* Concate lists in arr. No dummy head required for the list */
struct list_head *b16sort(struct list_head *arr[])
{
struct list_head *begin = 0, *end = 0, *tmp = 0;
int size = 0;
for (int i = 0; i < 15; i++) {
if (arr[i] != 0) {
tmp = arr[i]->prev;
if (size != 0) {
end->next = arr[i];
let HOMEWORK_NOTE_ID = '' // hackmd note to write to
let HACKMD_API_KEY = '' // your hackmd api key
let GITHUB_PERSONAL_ACCESS_TOKEN = '' // currently not in use
let EMAIL = {
'recipient': '',
'subject': 'Linux 核心課程: 已收到第 4 次作業的提交',
'body': '(本信件是自動產生,請不要回覆)\n請詳閱 https://hackmd.io/@sysprog/linux2024-lab0 的說明,確認 HackMD 筆記的存取權限及內容規範符合預期,若登記成功,應可在 https://hackmd.io/@sysprog/linux2024-homework4 見到你提交的 GitHub/HackMD 超連結。\n\n'
}
let PUBLISHED_LINKS = []; // kind of ugly but it works
@idoleat
idoleat / check.gs
Created January 20, 2024 03:36
version 3
let HOMEWORK_NOTE_ID = 'your note id';
let HACKMD_API_KEY = 'your api key';
let EMAIL = {
'recipient': '',
'subject': 'Thanks for handing in your home work!',
'body': ''
}
let PUBLISHED_LINKS = []; // kind of ugly but it works
function setupForm() {
@idoleat
idoleat / check.gs
Last active December 26, 2023 15:19
version 2
let HOMEWORK_NOTE_ID = 'your note id';
let HACKMD_API_KEY = 'your key';
let EMAIL = {
'recipient': '',
'subject': 'Thanks for handing in your home work!',
'body': ''
}
let PUBLISHED_LINKS = []; // kind of ugly but it works
function onOpen(e) {
@idoleat
idoleat / check.gs
Last active December 26, 2023 15:14
version 1
let HOMEWORK_NOTE_ID = 'your note id';
let HACKMD_API_KEY = 'your key';
let EMAIL = {
'recipient': '',
'subject': 'Thanks for handing in your home work!',
'body': ''
}
function onOpen(e) {
let currentForm = FormApp.getActiveForm();
@idoleat
idoleat / PackagesForGS60.md
Last active October 8, 2023 06:33
Temp GS60 Specific config in my Arch. To be reverted after moving the disk to new computer.

pacman

intel-ucode (auto detected by grub-mkconfig)
vulkan-intel
lib32-vulkan-intel

Cron jobs

root user

@reboot disable gpe61
@reboot msi-ketboard

@idoleat
idoleat / frappe.ron
Created June 23, 2023 04:01
Gitui: Modified catppuccin frappe theme
(
selected_tab: Reset,
command_fg: Rgb(76, 79, 105), //original 198, 208, 245
selection_bg: Rgb(98, 104, 128),
selection_fg: Rgb(198, 208, 245),
cmdbar_bg: Rgb(230, 233, 239), //original 41, 44, 60
cmdbar_extra_lines_bg: Rgb(230, 233, 239),
disabled_fg: Rgb(180, 183, 191), //original 131, 139, 167
diff_line_add: Rgb(166, 209, 137),
diff_line_delete: Rgb(231, 130, 132),
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define my_sizeof(type) \
({ \
__typeof__(type) _a[2]; \
(size_t) & _a[1] - (size_t)&_a[0]; \
})
@idoleat
idoleat / init.lua
Last active November 10, 2022 12:03
Change init.vim to init.lua
vim.cmd("set encoding=UTF-8")
vim.cmd("set number")
vim.cmd("set ruler")
vim.cmd("set visualbell")
vim.cmd("set wrap")
vim.cmd("set tabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set expandtab")
-- make sure the packer plugin manager is installed
@idoleat
idoleat / catppuccin_frappe_mod.toml
Last active August 5, 2023 07:43
My helix config and modified catppuccin_frappe, everforest_dark theme
inherits = "catppuccin_frappe"
"ui.bufferline.active" = { fg = "blue", bg = "surface0", modifiers = ["bold",] }