Skip to content

Instantly share code, notes, and snippets.

View selimhex's full-sized avatar
🥴

Szm selimhex

🥴
View GitHub Profile
@selimhex
selimhex / responsive-whatsapp-web.md
Last active July 6, 2025 12:55 — forked from Axenide/responsive-whatsapp-web.md
Responsive UI for WhatsApp Web.

Responsive WhatsApp Web

Using Stylus and adding this CSS will get you a responsive UI for WhatsApp Web (which I think is long overdue, come on Meta).

/* magic number roughly meaning mobile-ish in my laptop*/
@media (max-width: 820px) {
	#app > div > div:last-child > header {
		display: none;
	}
# rest is basically this one-liner with better fallbacks
# open $(git remote -v | grep "push" | fzf | awk '{print $2}' | sed -e "s/^.*@//" -e "s/\:/\//" -e "s/\.git$//" | sed -e "s/^/https:\/\//")
open_remote() {
_formatSshUrlToHttp() {
sshUrl="$1"
url=$(echo $sshUrl | sed -e "s/^.*@//" -e "s/\:/\//" -e "s/\.git$//" -e "s/^/https:\/\//")
echo $url
}
_remoteToUrl() {
@selimhex
selimhex / search-and-destroy.sh
Last active May 22, 2024 20:20
search (filter) and destroy (kill) running process oneliners
# list all the processes and filter by "ssh" and kill the selected process
ps -eo pid,command | grep ssh | fzf | awk '{print $1}' | xargs kill
# search for the process and kill the selected process
# use ' before keyword to search for the exact keyword (e.g. 'ssh)
ps -eo pid,command | fzf | awk '{print $1}' | xargs kill

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@selimhex
selimhex / sx-lwc-utils.js
Last active March 22, 2024 15:32
debugging helper for weird js frameworks (#lwc😭)
prettyJson = (obj) => {
return JSON.stringify(obj, null, 2);
};
log(obj, name = "", color = null, table = false) {
if (table) {
console.log(`%c${name}`, `color: ${color || "unset"}`);
console.table(obj);
return;
}
console.log(`%c${name}`, `color: ${color || "unset"}`, this.prettyJson(obj));
@selimhex
selimhex / encode_decode_all_webp.sh
Last active March 16, 2022 13:23
encode / decode directory of webp files
# https://developers.google.com/speed/webp/faq#how_can_i_convert_my_personal_images_files_to_webp
# convert all jpeg files in a directory
for F in *.jpg; do cwebp $F -o `basename ${F%.jpg}`.webp; done
# decode all webp files in a directory to png
for F in *.webp; do dwebp $F -o `basename ${F%.webp}`.png; done
@selimhex
selimhex / create_directories_from_array.sh
Last active March 22, 2024 15:31
create directories from array
mkdir -p {Devrim,Dominique,Frank,Görkem,Henrik,Jens,Jürgen,Kevin,Rosanna,Selim}
echo "done"
@selimhex
selimhex / .bash_profile
Last active May 31, 2020 12:24
bash alias function to start a local php server anywhere
# a primitive alias function to start a local php server
# add this function to ~/.bash_profile and restart terminal
# $ stphpserverhere or $ stp[tab]
# no arguments starts the server at the current directory (pwd)
# stphpserverhere 0 > starts the server at the default root
# stphpserverhere ~/Documents/anotherDir starts the server at anotherDir.
stphpserverhere() {
serverroot=$(pwd)
echo $serverroot
@selimhex
selimhex / folders_to_link.txt
Created April 5, 2020 15:27
read folder names from a txt file and create soft links to them from the current directory in bash