Skip to content

Instantly share code, notes, and snippets.

View manan-gup's full-sized avatar

Manan Gupta manan-gup

  • New Delhi
View GitHub Profile
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@eguven
eguven / brew-list.sh
Last active November 16, 2024 19:55
List all packages installed using Homebrew and their sizes
# this original one uses values returned from 'brew info'
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
# faster alternative using 'du'
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active October 15, 2024 11:51
Eric Elliott's Master the JavaScript Interview Series
@Geoff-Ford
Geoff-Ford / composing-software.md
Last active November 10, 2024 09:04
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@steven2358
steven2358 / ffmpeg.md
Last active November 11, 2024 04:45
FFmpeg cheat sheet
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@psenger
psenger / index.js
Created March 3, 2020 01:25
[Example of Limiting Concurrency using ES6 iterator] #JavaScript
/*
Reference: https://stackoverflow.com/questions/40639432/what-is-the-best-way-to-limit-concurrency-when-using-es6s-promise-all
[Symbol.iterator]() is equivalent to .values()
const iterator = [1,2,3][Symbol.iterator]()
*/
const iterator = [1,2,3].values()
// loop over all items with for..of
for (const x of iterator) {
@SpaghettiBorgar
SpaghettiBorgar / mpv-clip.lua
Created April 5, 2020 18:42
mpv script to quickly create gifs, video clips, and sound clips
-- Create animated GIFs with mpv
-- Requires ffmpeg, gifski, exiftool, and vorbis-tools.
-- Based on github.com/Scheliux/mpv-gif-generator
-- Usage: "g" to set start frame, "G" to set end frame,
-- "Ctrl+g" to create gif
-- "Ctrl+v" to create video clip
-- "Ctrl+a" to create audio clip
-- Metadata about the filename and timestamps will be written in the comment tag
local msg = require 'mp.msg'
@kppullin
kppullin / config.fish
Created May 16, 2020 03:51
Fish shell + WSL2 + gnome-keyring / secret-tool
#
# This fish config sets up a working `gnome-keyring` on WSL2.
# I imagine it will work with WSL1 as well, perhaps after adjusting the `DISPLAY` value.
#
# Based off this bash script: https://askubuntu.com/questions/815327/running-gnome-keyring-on-wsl-windows-subsystem-for-linux
# Tested and working with `aws-vault` and `jetbrains-toolbox`.
#
# Be sure your x server is running!!!
set -x DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
@bitingsock
bitingsock / ytdl-preload.lua
Last active July 31, 2024 18:38
Precache the next entry in your playlist if it is a network source by downloading it to a temp file ahead of time. Change Line 20 to temp directory. It will delete the directory on exit.
----------------------
-- #example ytdl_preload.conf
-- # make sure lines do not have trailing whitespace
-- # ytdl_opt has no sanity check and should be formatted exactly how it would appear in yt-dlp CLI, they are split into a key/value pair on whitespace
-- # at least on Windows, do not escape '\' in temp, just us a single one for each divider
-- #temp=R:\ytdltest
-- #ytdl_opt1=-r 50k
-- #ytdl_opt2=-N 5
-- #ytdl_opt#=etc