Skip to content

Instantly share code, notes, and snippets.

View murtuzaalisurti's full-sized avatar
:octocat:
breaking and fixing code

Murtuzaali Surti murtuzaalisurti

:octocat:
breaking and fixing code
View GitHub Profile
@bramus
bramus / bookmarklet.md
Last active September 20, 2024 07:01
Mastodon User Page Bookmarklet
@bobmonsour
bobmonsour / getDescription.js
Created April 13, 2023 04:45
An Eleventy filter that extracts the meta description from within the <head> element of a web page
// getDescription - given a url, this Eleventy filter extracts the meta
// description from within the <head> element of a web page using the cheerio
// library.
//
// The full html content of the page is fetched using the eleventy-fetch plugin.
// If you have a lot of links from which you want to extract descriptions, the
// initial build time will be slow. However, the plugin will cache the content
// for a duration of your choosing (in this example, it's set to 1 day).
//
// The description is extracted from the <meta> element with the name attribute
@bobmonsour
bobmonsour / feedsformulti.js
Last active January 19, 2024 07:28
Process an OPML file to generate an array of feeds
// Read from an OPML file and write to a JSON file, processing the OPML file
// and producing the following for each of the feed items in the file:
// name: title of the feed (from the title attribute)
// url: URL of the feed (from the htmlUrl attribute)
// feed: URL of the feed (from the xmlUrl attribute)
// feedtype: type of feed (from the type attribute)
//
// NOTE: This only extracts feeds from the "CSS" and "Eleventy" outlines.
// Remove that test if you wish to extract all of the feeds.
//
@Spikeysanju
Spikeysanju / ffmpeg-cheatsheet.md
Last active August 27, 2024 03:26
A comprehensive cheatsheet of FFmpeg commands with descriptions and examples, covering video and audio processing tasks such as format conversion, resizing, trimming, extracting audio, and adding effects.

FFmpeg Cheatsheet

Common FFmpeg Options

Option Description Example
-i Input file ffmpeg -i input.mp4
-vf Video filters (apply effects to video) ffmpeg -i input.mp4 -vf "scale=1280:720" output.mp4
-c:v Video codec (specify video compression method) ffmpeg -i input.mp4 -c:v libx264 output.mp4
-c:a Audio codec (specify audio compression method) ffmpeg -i input.mp4 -c:a aac output.mp4
@t3dotgg
t3dotgg / try-catch.ts
Last active November 30, 2025 20:25
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};