Skip to content

Instantly share code, notes, and snippets.

View muchfahmiarif's full-sized avatar
🎯
Focusing

Muchammad Fahmi Arif muchfahmiarif

🎯
Focusing
View GitHub Profile
@muchfahmiarif
muchfahmiarif / flameshot-on-wayland.md
Created October 13, 2025 22:26
Snap Capture Image from Ubuntu Wayland

Introductiong

When running image capture using Flameshot on Wayland, I encountered a problem where image capture from Flameshot did not work and did not display the Flameshot GUI. Previously, it worked fine using X11, but when I switched to Wayland, it didn't work. There are a few things you need to know: Flameshot (Qt app) on Wayland tries to use XCB to capture the screen. Under Wayland, direct screen capture is blocked for security reasons. It must instead use the xdg-desktop-portal API (via xdg-desktop-portal-gnome and xdg-desktop-portal) to request screenshots.

Step to fix

  1. Install the correct portals and Wayland support
sudo apt update
sudo apt install -y \
  qtwayland5 \
  xdg-desktop-portal \

List All Download

  1. List all format:
yt-dlp -F '<link-youtube>'
  1. Download song to mp3:
yt-dlp -f 140 -x --audio-format mp3 '<link-youtube>'
  1. Download video + sound:
@muchfahmiarif
muchfahmiarif / send-mail-using-resend.ts
Created April 11, 2025 04:14
send-mail-using-resend
import { Resend } from "resend";
const resend = new Resend("RESEND_API_KEY");
(async function () {
try {
const data = await resend.emails.send({
from: "YOUR_NAME <NAME@YOUR_DOMAIN_RESEND>",
to: ["NAME_TARGET@DOMAIN_TARGET"],
subject: "Hello World",
html: "<strong>It works!</strong>",
@muchfahmiarif
muchfahmiarif / download_file_from_spreadsheet.md
Last active March 15, 2025 14:34
download_file_from_link_spreadsheet

Download File From Link in Spreadsheet Using Python

Configure OAuth Concent Screen

  1. Open Google Cloud Console
  2. Navigate to APIs & Service > OAuth concent screen
  3. Fill in the required fields:
    • App name: Enter a name for your app
    • User support email: Enter your email address
  • Developer contact information: Enter your email address