Skip to content

Instantly share code, notes, and snippets.

View garrettheaver's full-sized avatar

Garrett Heaver garrettheaver

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <pthread.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/pkcs12.h>
/* I hate the globals being here - don't judge me, this whole thing
* was supposed to just be quick and dirty to get the job done! ;-) */
WAIT
#!/usr/bin/env ruby
require 'nokogiri'
ARGV.each do |path|
name = File.basename(path, '.svg')
doc = Nokogiri::XML(File.read(path))
doc.xpath('//@id').remove
doc.xpath('//@fill').each{ |a| a.value = '#{$color0}' }
#!/usr/bin/env ruby
$stdin.each_line do |line|
path = line.chomp
base = File.basename(path, '.m4a')
name = File.join(File.dirname(path), "#{base}.mp3")
next if File.exists?(name)
cmd = %(ffmpeg -i "#{path}" -acodec libmp3lame -ab 160k "#{name}" < /dev/null)
#!/bin/sh
# mass deskew scanned files via command line
# - requires: ImageMagick and Deskew Tool
# - see http://galfar.vevb.net/wp/tag/deskew
for d in "$@"; do
file=`basename "$d" .pdf`
cd "`dirname "$d"`"