Skip to content

Instantly share code, notes, and snippets.

View wl_num_bits.cpp
// ref: https://users.wfu.edu/natalie/s14phy770/projects/
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <random>
View pptx_encode_images.py
#!/usr/bin/env python
import os
import glob
import sys
import json
import subprocess
import zipfile
import io
import shutil
View msys2_etc_bash_diff.patch
diff -u a/bash.bash_logout b/bash.bash_logout
--- a/bash.bash_logout 2024-01-06 23:09:23.578819100 +0900
+++ b/bash.bash_logout 2024-01-06 23:06:58.672315000 +0900
@@ -10,6 +10,6 @@
# System-wide bashrc file
# when leaving the console clear the screen to increase privacy
-if [ "$SHLVL" = 1 ]; then
- [ -x /usr/bin/clear ] && /usr/bin/clear
-fi
@aont
aont / caw.py
Last active January 24, 2024 03:04
change active window
View caw.py
#!/usr/bin/env python
import os
import sys
import ctypes
import ctypes.wintypes
import time
import ctypes
View github_img_load_later.js
Array.from(document.querySelectorAll("img[src^=\"https://private-user-images.githubusercontent.com/\"]")).forEach((img, index, array)=>{
if(!img.complete) {
let imgSrc = img.src;
img.src = "";
img.style.display = "none";
// img.setAttribute("_src", imgSrc)
let anchor = img.parentElement;
// anchor.removeChild(img);
let textNode = document.createTextNode("click to view image");
anchor.appendChild(textNode)
View github_img_to_canvas.js
Array.from(document.querySelectorAll("img[src^=\"https://private-user-images.githubusercontent.com/\"]")).forEach((img, index, array)=>{
if(img.complete) {
var anchor = img.parentElement;
anchor.removeAttribute("href")
// console.log(img)
var canvas = document.createElement("canvas")
canvas.height = img.naturalHeight
canvas.width = img.naturalWidth
canvas.style.maxWidth = "100%"
var context = canvas.getContext("2d")
@aont
aont / ec2aux.py
Last active December 3, 2023 11:55
View ec2aux.py
import sys
import os
import datetime
import argparse
import re
import asyncio
import ipaddress
import socket
try: import tomllib as toml
View windows_terminal_restore_size.py
#!/usr/bin/env python
import sys
import os
import json
import ctypes
import pywintypes
import win32api
import win32gui
View markdown_link_copy.js
View wait_ec2_boot_complete.py
#!/usr/bin/env python
import boto3
import os
import sys
# import subprocess
# import botocore
# import botocore.errorfactory
import asyncio