Skip to content

Instantly share code, notes, and snippets.

View jimmyctk's full-sized avatar

Jimmy Cheung jimmyctk

View GitHub Profile
@jimmyctk
jimmyctk / dwebp.sh
Last active January 13, 2023 02:34
Drag and drop batch webp convert to png using dwebp on mac
#Download dwebp (WebP decoder tool) https://developers.google.com/speed/webp/download
#!/bin/bash
if ! command -v dwebp &> /dev/null
then
echo "dwebp could not be found"
if ! command -v brew &> /dev/null
then
echo "Homebrew could not be found"
exit
@jimmyctk
jimmyctk / gist:94c072b18617315fe79a95f730f59dd3
Created February 13, 2023 02:37
Drag and drop batch image crop and add white space using rust on mac
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 1000 100"
echo -e "\t [Target Resolution] [Border size]"
exit 1 # Exit script after printing help
}
@jimmyctk
jimmyctk / dwebp.bat
Last active October 23, 2023 17:03
Drag and drop batch webp convert to png using dwebp on Windows
@echo off
:: Check if the number of arguments is less than 2
if "%~1" == "" (
echo Usage: %0 "Path to dwebp.exe" [Input files/directories...]
exit /b
)
:: Set the path to dwebp.exe
set dwebp_path="%~1"
@jimmyctk
jimmyctk / final.py
Created February 21, 2024 08:26
Python get the final redirected URL from CSV
import csv
import requests
# Open the input CSV file
with open("location_import.csv", "r") as input_file:
# Create a CSV reader object
reader = csv.DictReader(input_file)
# Open the output CSV file
with open("location_export.csv", "w") as output_file:
# Create a CSV writer object