Skip to content

Instantly share code, notes, and snippets.

View eromatiya's full-sized avatar
😪
Busy

eromatiya

😪
Busy
  • Philippines
View GitHub Profile
@eromatiya
eromatiya / termrc.sh
Created April 21, 2021 05:44
Termux .bashrc
# ░█▀█░█▀▀░█▀█░█▀▀░█▀▀░▀█▀░█▀▀░█░█
# ░█░█░█▀▀░█░█░█▀▀░█▀▀░░█░░█░░░█▀█
# ░▀░▀░▀▀▀░▀▀▀░▀░░░▀▀▀░░▀░░▀▀▀░▀░▀
if [[ ! -z $(which neofetch) ]];
then
neofetch --ascii_distro android_small \
--disable cpu gpu memory packages
fi
@eromatiya
eromatiya / miui12-blur-go-brrr.md
Last active March 5, 2023 17:05
A guide to enable blur effects on MIUI 12 low-end devices

How to bring back the blur effects of MIUI 12 on low-end devices

If you have a low-end device, you probably noticed the gray background color on your control center and notification shade. Let's bring back the glorious blur effect by patching MiuiSystemUI.apk.

Prerequisites:

  • adb
  • apktool < v2.6.0
  • smali/baksmali
  • Code/Text Editor
@eromatiya
eromatiya / hex-to-percentage.md
Created October 15, 2020 06:06
Hex color alpha to percentage
  • 100% — FF
  • 95% — F2
  • 90% — E6
  • 85% — D9
  • 80% — CC
  • 75% — BF
  • 70% — B3
  • 65% — A6
  • 60% — 99
  • 55% — 8C
@eromatiya
eromatiya / backdrop.lua
Created September 16, 2020 13:36
[awesomewm] Client backdrop effect
local wibox = require('wibox')
local gears = require('gears')
local awful = require('awful')
local function update_backdrop(w, c)
local cairo = require('lgi').cairo
local geo = c.screen.geometry
w.x = geo.x
w.y = geo.y
@eromatiya
eromatiya / swipe-event.js
Created September 6, 2020 10:17
[Javascript] Swipe gestures
// Copyright @manilarome
class SwipeEvent {
constructor(element, callback) {
this._passedElement = element;
this._passedCallback = callback;
this._startX = 0;
this._startY = 0;
this._endX = 0;
this._endY = 0;
this._startTime = 0;
@eromatiya
eromatiya / conflict.sh
Created August 31, 2020 10:37
Create git merge conflict
#!/usr/bin/env bash
mkdir git-repo
cd git-repo
git init
touch my_code.sh
git add my_code.sh
echo "echo Hello" > my_code.sh
git commit -am 'initial'
git checkout -b new_branch
@eromatiya
eromatiya / check-distro.sh
Created August 28, 2020 22:47
Check distro using $BASH
#!/usr/bin/env bash
# return an awkable string consisting of
# unix OS type, or
# Linux dist, or
# a long guess (based on /proc), or
# no clue
giveUp () {
echo "Unknown"
exit 0
@eromatiya
eromatiya / git-reset-history.md
Created May 11, 2020 11:50
Reset github repo history

My dotfiles became so big that cloning it even using depth 1 is a pain in the ass. Yeah, I have a very slow internet connection. That's why I need to reset the history.

$ # Reset history
$ rm -rf .git

$ # Re-initialize
$ git init
$ # Add file contents to index
$ git add .

@eromatiya
eromatiya / call-meta-call.lua
Created April 24, 2020 06:12
Lua __call methamethod example
#!/usr/bin/env lua
meta_call = require('meta-call')
-- Index
str_table = {
'string1',
'string2',
'string3',
'string4'
@eromatiya
eromatiya / check-capslock-status-linux.cpp
Last active January 7, 2021 00:27
Check CapsLock Status Programatically in Linux
#include <stdio.h>
#include <stdlib.h>
#include <X11/XKBlib.h>
/* Compile this with -lX11 */
int main ()
{
Display *display;
Status status;