Skip to content

Instantly share code, notes, and snippets.

View greymeister's full-sized avatar

greymeister greymeister

View GitHub Profile
@greymeister
greymeister / gif_to_mpeg.sh
Created July 23, 2014 23:45
gif_to_mpeg - convert gif to mpeg video file using imagemagick and ffmpeg
#!/bin/bash
## gif_to_mpeg
## Based on http://stackoverflow.com/a/3212958 and http://apple.stackexchange.com/a/103834
## charles.erwin@vendscreen.com
## Take first argument which should be a filename
if [ -z "$1" ]
then
echo "Usage: $0 'filename.gif'"
@greymeister
greymeister / %snippet:;smoji%
Created September 20, 2014 03:51
emoji.xyz URL shortener (I use ;smoji)
#!/usr/bin/php
<?php
// Request: Local emoji-web (http://emoji.xyz/shorten)
$ch = curl_init("http://emoji.xyz/shorten");
curl_setopt($ch, CURLOPT_POST, TRUE);
// Headers
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
@greymeister
greymeister / WeiDU.log
Last active August 29, 2015 14:07
Baldur's Gate Trilogy Playthrough Mod List
// Log of Currently Installed WeiDU Mods
// The top of the file is the 'oldest' mod
// ~TP2_File~ #language_number #component_number // [Subcomponent Name -> ] Component Name [ : Version]
~SETUP-BGTTWEAK.TP2~ #0 #2300 // Disable hostile reaction after charm: 8
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #40 // Change Viconia's Skin Color to Dark Blue: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #60 // Weapon Animation Tweaks: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #70 // Icewind Dale Casting Graphics (Andyr): v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #100 // Commoners Use Drab Colors: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #110 // Icon Improvements: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #1010 // More Interjections: v9
@greymeister
greymeister / LHM Test.groovy
Last active August 29, 2015 14:11
Some Groovy Semantics I don't quite get
blah = [name: 'poop', status: 'tudus', null: 'EAD']
foo = 'name'
bar = 'status'
baz = null
println blah[baz]
blah.put(null, 'NOOBER')
@greymeister
greymeister / resize_png_files.sh
Created February 12, 2015 19:30
Resize PNG files to 50x80
#!/bin/bash
export pad="60"
printf "%-${pad}s" "Counting files:"
echo `ls -1 | wc -l`
#printf "%-${pad}s" "Create copies of .png files"
# for filename in *.png; do cp "$filename" "${filename}_big.png"; done && echo "done"
#
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* * * * * echo "How did we get here?"
@greymeister
greymeister / createArchiveDirs.groovy
Created March 31, 2015 04:20
Creates some Archive Directories
baseDir = "/Users/user/Documents/Archive"
alphabetRange = ('A'..'Z')
alphabetList = new ArrayList (alphabetRange)
alphabetList.each{letter ->
file = new File("${baseDir}/$letter").mkdirs()
}
@greymeister
greymeister / UniqueSuffixes.java
Created April 16, 2015 22:31
Sufficient Suffixes
private static int counter = 0;
private static synchronized java.lang.String getUniqueSuffix() {
// reset the counter if it is greater than 99999
if (counter > 99999) {
counter = 0;
}
counter = counter + 1;
return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter;
}
@greymeister
greymeister / fuyoutube.txt
Last active May 27, 2019 08:27
Block Annoying Youtube Sign In Button
! 4/20/2019 https://www.youtube.com
www.youtube.com##.size-small.style-suggestive.ytd-button-renderer.style-scope
! 5/27/2019 https://www.youtube.com
www.youtube.com##.ytd-button-renderer.style-scope.yt-simple-endpoint