Skip to content

Instantly share code, notes, and snippets.

@thomastweets
thomastweets / PNGWhiteTrim.py
Last active June 23, 2025 15:42
Python script to trim all png images with white background in a folder
import Image
import sys
import glob
import ImageOps
# Trim all png images with white background in a folder
# Usage "python PNGWhiteTrim.py ../someFolder"
try:
folderName = sys.argv[1]
@gcko
gcko / related.py
Last active August 7, 2023 09:32
Django Custom Model ForeignKey Field for Spanning Databases
@creativcoder
creativcoder / gist:5dc5c2e35cd218ce9b5d
Last active August 22, 2022 14:41
Get list of installed packages(apps) in android via adb shell
Issue this command to terminal with your device connected :
$ adb shell pm list packages
If that doesn't work, then:
$ adb shell
$ su
$ pm list packages
@ryanlerch
ryanlerch / generate-gif-from-webm
Created May 1, 2014 14:47
Generates an Animated GIF from a webm
#!/bin/bash
echo "$1"
mkdir /tmp/"$1"/
gst-launch-1.0 filesrc location="$1" ! decodebin ! videoconvert ! pngenc ! multifilesink location="/tmp/$1/%04d.png"
echo "Trim files manually, and press enter to generate the GIF"
nautilus /tmp/"$1"/ &
read
echo "Generating GIF..."
convert -delay 5 /tmp/"$1"/*.png /tmp/"$1"/animation.gif
@ahmozkya
ahmozkya / README.md
Last active July 2, 2025 01:46
Homebrew with DNSMasq + DNSCrypt-proxy (OpenDNS)
#!/usr/bin/env python
'''
DEPENDENCIES:
$ brew install ffmpeg
$ brew install imagemagick
$ python ./mov2gif.py input.mov output.gif 15
'''
@jehiah
jehiah / simple_args_parsing.sh
Created March 4, 2011 16:56
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"