Skip to content

Instantly share code, notes, and snippets.

View teohhanhui's full-sized avatar

Teoh Han Hui teohhanhui

View GitHub Profile
@DavidBuchanan314
DavidBuchanan314 / widevine_fixup.py
Last active April 24, 2024 06:24
Patch aarch64 widevine blobs from ChromeOS to work on non-ChromeOS linux, including platforms with 16K page size like Apple Silicon / Asahi Linux
"""
MIT License
Copyright (c) 2023 David Buchanan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@eNV25
eNV25 / hp-bios-update.md
Last active May 2, 2024 17:24
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

@Damperen
Damperen / NativeDarkMessenger.user.js
Last active January 3, 2024 12:18
Dark mode for messenger.com, the code is already there as you can see. Facebook just haven't gotten around to implementing it in the UI yet..
// ==UserScript==
// @name Native Dark Messenger
// @namespace https://github.com/Damperen
// @version 1.9.5
// @description Almost Native dark mode for Messenger
// @author https://github.com/Damperen
// @match https://www.messenger.com/*
// @grant none
// @run-at document-idle
// @icon https://i.imgur.com/VNn3FEX.png
@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@zmwangx
zmwangx / No longer able to make public gists secret.md
Last active April 11, 2024 22:22
No longer able to make public gists private — message to GitHub

We've been able to toggle visibility of gists since 2014 (https://github.com/blog/1837-change-the-visibility-of-your-gists), but I just noticed that I can no longer make public gists private. That is, when I edit private gists I still see the "Make Public" button, but not the other way round — there's only a "Delete" button when I edit public gists; the "Make Secret" which should be next to it (as shown in the screencast in the linked blog post) is nowhere to be found. I made a screenshot and a screencast demonstrating the issue, both of which are attached. Could you please confirm this issue? Was this an intentional change, and why? Thank you for your attention.

gist-unable-to-make-secret

![gist-unable-to-make-secret](https://cloud.githubusercontent.com/assets/4149852/16898407/c76db210-4c0b-11e6-9108-0450f1edebb4.gif)
-- betterchapters.lua
-- Loads the next or previous playlist entry if there are no more chapters in the seek direction.
-- To bind in input.conf, use: <keybind> script_binding <keybind name>
-- Keybind names: chapter_next, chapter_prev
-- Recommended to use with autoload.lua
function chapter_seek(direction)
local chapters = mp.get_property_number("chapters")
local chapter = mp.get_property_number("chapter")
if chapter == nil then chapter = 0 end
@skx
skx / lsb_release
Last active August 20, 2023 14:31
Simple alternative to /usr/bin/lsb_release
#!/bin/sh
#
# This is a simple alternative to /usr/bin/lsb_release which
# doesn't require python.
#
# If /etc/os-release exists then we use that to output data
# in a compatible format to the original lsb_release utility.
#
# I consider this script trivial enough to be in the public-domain,
# but any patches or suggestsions will be welcome.
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d