Skip to content

Instantly share code, notes, and snippets.

View gliu20's full-sized avatar

George gliu20

View GitHub Profile
@gliu20
gliu20 / archinstall.sh
Last active July 7, 2024 04:46
install arch linux to my liking
checks () {
if [[ $(ls /sys/firmware/efi/efivars) ]]; then
echo "[INFO] Found EFI Boot"
else
echo "[WARNING] EFI boot not detected"
fi
if [[ $(ping -c 3 google.com | grep icmp_seq) ]]; then
echo "[INFO] Found working internet"
@gliu20
gliu20 / auto-french.js
Created July 12, 2019 19:42
French vocab extractor for the online holt textbook (you need a my.hrw.com account)
console.log('French vocab extractor for the online holt textbook (run in the console)');
(function () {
function setSelectedIndex(s, v) {
for ( var i = 0; i < s.options.length; i++ ) {
if ( s.options[i].text == v ) {
@gliu20
gliu20 / darkmode.js
Created July 12, 2019 19:33
Save your eyes. Dark mode for every page. (Warning:Images may become distorted)
// turn on dark mode
javascript:
document.head.appendChild((function () {
var a = document.createElement('style');
a.innerHTML = "html {filter:saturate(0.1) hue-rotate(180deg) invert(1) contrast(0.86) hue-rotate(70deg) saturate(25) hue-rotate(-70deg);background:#0a0a0a}html img, html image {filter: hue-rotate(180deg) invert(1) saturate(0.5)!important;}";
return a;
})());
void 0;
// turn off dark mode
@gliu20
gliu20 / docxToTxt.sh
Created June 9, 2019 17:23
Convert .docx to .txt
libreoffice --headless --convert-to "txt:Text (encoded):UTF8" mydocument.doc
@gliu20
gliu20 / nyt.js
Last active March 17, 2023 15:35
Bookmark to latest New York Times Front Page PDF
javascript:(function () {
var addZero = function (num) {
num = num.toString();
if (num.length < 2) {
num = "0" + num;
}
if (num.length < 2) {
num = "0" + num;
}
return num;