Skip to content

Instantly share code, notes, and snippets.

View Miigon's full-sized avatar
🎯
Focusing

Miigon

🎯
Focusing
View GitHub Profile
echo off
cls
echo ============================================================
echo Joycon re-pairing utility by Miigon
echo Useful for connecting Joycon to Bluetooth dongles that doesn't support
echo proper reconnect. (eg. Realtek)
echo See: https://www.reddit.com/r/yuzu/comments/11hssgt/
echo ============================================================
@Miigon
Miigon / bodgeimagesort.html
Last active August 12, 2022 06:51
A bodged up tool to categorize videos and images into different folders easily.
<!-- NOTE: open this page in browser locally *without serving* (Author: miigon) -->
<body><div id="display" style="width: 100%; height: 75%; margin: 2px; border: solid;">
<video id="video" style="width: 100%; height: 100%;" controls autoplay></video>
<image id="image" style="width: 100%; height: 100%; object-fit: contain;"/>
</div>
<div id="text" style="width: 100%; height: 20%; margin: 2px; padding: 10px; border: solid;"></div>
<script>
di=document.getElementById("display");
vi=document.getElementById("video");
@Miigon
Miigon / about_kvm.txt
Created March 24, 2022 04:45
a backup of the instructions used to set up a win10 kvm on linux
`~/kvm` contains resourses used to set up kvm, gpu passthrough, virtio and bridged
networking.
`/etc/default/grub`:
added 'intel_iommu=on iommu=pt kvm.ignore_msrs=1 video=efifb:off' to GRUB_CMDLINE_LINUX_DEFAULT
regenerated grub config using `sudo update-grub`
added `softdep nouveau pre: vfio-pci` to /etc/modprobe.d/vfio.conf so that vfio
would load before nouveau.
@Miigon
Miigon / naturalSort.js
Last active March 29, 2021 18:20
natural sort algorithm for sorting file name in a more intuitive "human-friendly" way.
// natural sort algorithm in JavaScript by Miigon.
// 2021-03-30
//
// GitHub: https://github.com/miigon/
function natSort(arr){
return arr.map(v=>{ // split string into number/ascii substrings
let aux = []
let str = v
for(let i=0;i<str.length;i++) {
@Miigon
Miigon / minishell.c
Created March 21, 2021 10:50
a minishell in C created for lab1 of my operating system course.
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <string.h>
#include <stdlib.h>
#define prompt "\e[32mminishell\e[0m> "
void builtin_exit(char *argv[16]) {
exit(0);
@Miigon
Miigon / my_pmset_configuration.sh
Created January 27, 2020 21:40
My pmset configuration on my MacBook Pro 13'' Early 2015
#!/bin/bash
# macOS power management settings optimized for longer battery life
# Tested on MacBook Pro 13'' Early 2015
# Miigon 2020-01-28
echo " "
echo "######################## DISCLAIMER ########################"
echo "Although this script can be run, it's more intended to show"
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <GL/glew.h>
const char *vertexShaderSource = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
"}\0";