Skip to content

Instantly share code, notes, and snippets.

@zax4r0
zax4r0 / alt_tab.sh
Last active June 24, 2024 11:07
scripts
#!/bin/sh
###############
# Cycle windows
# (C) 2024 zax4r0 <zax4r0@gmail.com>
# GNU General Public License v3.0
###############
timer_file=$(dirname $(realpath "$0"))"/alt_tab_timer.txt"
@zax4r0
zax4r0 / axios.ts
Created June 15, 2024 08:40
axiosclinet
/** @format */
import { useCookies } from "next-client-cookies";
import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios";
import { getCookies } from "next-client-cookies/server";
const TOKEN_KEY = "token";
const isServer = typeof window === "undefined";

Finding/Fixing Unintended Body Overflow


In some cases, there might be an element that is literally wider than the document is, which might cause horizontal overflow scrolling. You could use a little JavaScript to help you find the culprit.

open DevTools in browser and run this on console u will get the element causing overflow

var docWidth = document.documentElement.offsetWidth;

[].forEach.call(
@zax4r0
zax4r0 / youtube-dl.md
Created October 30, 2021 17:19 — forked from harishkannarao/youtube-dl.md
youtube-dl

youtube-dl

youtube-dl is an opensource command line tool to download video or audio from online video streaming services.

Videos downloaded in mkv or webm extensions can be played by VLC Media player in all major devices and operating systems including iPhone, Android devices.

Tool website: https://youtube-dl.org/

This gist shows the example commands to use the tool and doesn't support or encourage piracy or violation of copyrights of the online streaming service or the author of the content

Installing youtube-dl:

@zax4r0
zax4r0 / zram Arch.md
Last active June 16, 2024 09:40
Zram On Arch

zRam is a virtual memory compression using block devices named /dev/zram using a fast compression algorithm (LZ4) that compress the least recently used (LRU) or inactive space in the memory allows the GNU/Linux kernel to free up more memory with less performance hit.

zRam is greatly increased the available amount of memory by compressing memory without swap disks/partition. It is recommended for the user to use zRam instead of not use/disable the swap to prevent out of memory (OOM) killer. Create a zRam block devices Load the zRam modules to the kernel using modprobe:

sudo modprobe zram

Set the zRam extremely fast compression algorithm using lz4: