Skip to content

Instantly share code, notes, and snippets.

View RuchirChawdhry's full-sized avatar
🇨🇦

Ruchir Chawdhry RuchirChawdhry

🇨🇦
View GitHub Profile
@RuchirChawdhry
RuchirChawdhry / todoist.json
Last active April 19, 2024 01:44
Todoist.json
{
"version": "9.1.4",
"license": "",
"extract_dir": "\\$PLUGINSDIR",
"url": "https://electron-dl.todoist.net/windows/Todoist-win32-9.1.4.exe#/dl.7z",
"depends": "",
"homepage": "https://todoist.com/",
"hash": "325A49BBB864F2EBEFE44BD6AB932900A12317C8E17334DC52BD3C0E8D3EE526",
"pre_install": [
"Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-64.7z\" \"$dir\"",
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
iwr -useb get.scoop.sh | iex
scoop install aria2
scoop config aria2-warning-enabled false
scoop install 7zip
scoop install git
scoop install nodejs
@RuchirChawdhry
RuchirChawdhry / sitemap_urls.sh
Last active February 5, 2021 10:53
Parses urls in a sitemap to stdout. Must have xmlstarlet installed.
curl -s $1 | xmlstarlet sel -t -v "//*[local-name()='loc']/text()"
@RuchirChawdhry
RuchirChawdhry / np-array-image-notebook.py
Last active June 27, 2020 07:01
Show numpy array as image in Jupyter Notebook (Python 3)
import numpy as np
from PIL import Image
from IPython import display
from io import BytesIO
def show_array(arr, fmt="png"):
arr = np.uint8(arr)
f = BytesIO()
Image.fromarray(arr).save(f, fmt)
display.display(
@RuchirChawdhry
RuchirChawdhry / ffprobe_key_frames.sh
Created June 9, 2020 15:52
ffprobe - key frames (number)
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 -skip_frame nokey video.mp4
@RuchirChawdhry
RuchirChawdhry / ffprobe_frame_number.sh
Created June 9, 2020 15:49
ffprobe - count number of frames
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 video.mp4
@RuchirChawdhry
RuchirChawdhry / usb-devices-xml.sh
Created May 7, 2020 13:34
Exports information of all connected USB devices in xml and pipes to Sublime Text #macOS
system_profiler -xml SPUSBDataType | subl
@RuchirChawdhry
RuchirChawdhry / list-usb-detail.sh
Last active May 7, 2020 13:30
Lists all devices connected to USB on macOS
system_profiler SPUSBDataType
@RuchirChawdhry
RuchirChawdhry / drag-delay-macos.sh
Created May 1, 2020 11:45
Reads the current workspace drag delay and writes a value of 0 to remove that delay
defaults read com.apple.dock workspaces-edge-delay
defaults write com.apple.dock workspaces-edge-delay -float 0
killall Dock
@RuchirChawdhry
RuchirChawdhry / lid-state.sh
Created April 30, 2020 12:55
Find state of Macbook's lid - if it's opened or closed
sudo ioreg -r -k AppleClamshellState | grep "AppleClamshellState"