Skip to content

Instantly share code, notes, and snippets.

View AnwarShah's full-sized avatar

Anwar AnwarShah

View GitHub Profile
@pandasauce
pandasauce / radiff2.log
Last active September 22, 2020 14:22
Chrome 75.0.3770.142 font rendering fix
# 75.0.3770.142
0x04b58615 7626 => 9090 0x04b58615
0x04b5861d 31c0488945 => 9090909090 0x04b5861d
Due to a beautiful bug in Chromium, it turns out you don't need this binary patch and can **enable** subpixel positioning by asking Chrome **to disable it**: https://bugs.chromium.org/p/chromium/issues/detail?id=824153#c39
Needless to say, I won't be maintaining this gist any longer.
@cho2
cho2 / google-chrome-flatpak
Last active December 18, 2022 14:26
Google Chrome Flatpak
//eos3
wget https://origin.ostree.endlessm.com/keys/eos-flatpak-keyring.gpg
flatpak remote-add --gpg-import=eos-flatpak-keyring.gpg eos-apps https://ostree.endlessm.com/ostree/eos-apps
flatpak remote-add --gpg-import=eos-flatpak-keyring.gpg eos-sdk https://ostree.endlessm.com/ostree/eos-sdk
flatpak install eos-apps com.google.Chrome
git clone [email protected]:endlessm/eos-google-chrome-app.git
cd eos-google-chrome-app
chmod +x eos-google-chrome-app
./eos-google-chrome-app
@pjobson
pjobson / clover_boot_flags.md
Last active September 29, 2024 16:59
Clover Boot Flags

Clover Boot Flags

Flag Description
-v Verbose Mode
-x Safe Mode
-s Single User Mode
-no-zp Zone Postponing (use if hanging)
cpus=1 Single CPU Core Mode
-f No Kext Cache Mode (use if hanging)
wget https://origin.ostree.endlessm.com/keys/eos-flatpak-keyring.gpg
flatpak remote-add --gpg-import=eos-flatpak-keyring.gpg eos-apps https://ostree.endlessm.com/ostree/eos-apps
flatpak remote-add --gpg-import=eos-flatpak-keyring.gpg eos-sdk https://ostree.endlessm.com/ostree/eos-sdk
@AnwarShah
AnwarShah / favoriate-gnome-shell-extensions
Last active February 28, 2020 13:31
My favorite gnome shell extensions
Clipboard indicator - https://extensions.gnome.org/extension/779/clipboard-indicator/
CustomCorner - https://extensions.gnome.org/extension/1037/customcorner/
Dash to Dock - https://extensions.gnome.org/extension/307/dash-to-dock/
Dash to Panel - https://extensions.gnome.org/extension/1160/dash-to-panel/
Do Not Disturb Button - https://extensions.gnome.org/extension/964/do-not-disturb-button/
Extensions - https://extensions.gnome.org/extension/1036/extensions/
gistnotes - https://extensions.gnome.org/extension/917/gistnotes/
Hide Top Bar - https://extensions.gnome.org/extension/545/hide-top-bar/
Gnome-Prefs Button - https://extensions.gnome.org/extension/1054/gnome-prefs-button/
Impatience - https://extensions.gnome.org/extension/277/impatience/
@AnwarShah
AnwarShah / 99-replace-thin.conf
Created February 25, 2018 04:02
Replace thin fonts with ultralight using fontconfig
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- replace thin fonts for fira with ultralight, since thin is too light -->
<match target="font">
<test name="family" compare="contains">
<string>Fira Sans</string>
</test>
<test name="weight" compare="less_eq">
@magnetikonline
magnetikonline / README.md
Last active April 7, 2024 23:38
Bash internal field separator (IFS) usage.

Bash internal field separator (IFS) usage

The IFS internal variable is used to determine what characters Bash defines as word/item boundaries when processing character strings. By default set to whitespace characters of space, tab, and newline.

Running the example ifs.sh, comparing the difference between the default and setting only newline as a boundary we get the following output:

/path/to/first
file
/path/to/second
@chris-jamieson
chris-jamieson / setup.md
Created April 19, 2016 15:43
Set up Franz for Ubuntu
  • Download Franz for your distribution from MeetFranz.com
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz
  • (optional) wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franz
  • (optional) sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]
Name=Franz
Comment=
@mutability
mutability / OVERLAYFS
Last active August 10, 2024 02:39
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@lou
lou / base_uploader.rb
Last active March 22, 2022 11:59
Rails - Carrierwave validation of image size
class BaseUploader < CarrierWave::Uploader::Base
attr_reader :width, :height
before :cache, :capture_size
...
# for image size validation
# fetching dimensions in uploader, validating it in model
def capture_size(file)
if version_name.blank? # Only do this once, to the original version