Skip to content

Instantly share code, notes, and snippets.

@patrickgill
patrickgill / publicip.sh
Created February 29, 2016 01:11
get your public ip
curl ifconfig.me
@patrickgill
patrickgill / mkcue.cmd
Last active April 8, 2019 19:35
Create a cue file for a bin file (PSX) on Windows
echo FILE %1 BINARY > "%~n1.cue"
echo TRACK 01 MODE1/2352 >> "%~n1.cue"
echo INDEX 01 00:00:00 >> "%~n1.cue"
@patrickgill
patrickgill / 0_reuse_code.js
Created March 31, 2016 12:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@patrickgill
patrickgill / gist:790c85f73c02b48727dfdf8f42946c60
Created April 13, 2016 15:47
disk usage information on a Mac
df – displays disk usage information based on file system (ie: entire drives, attached media, etc)
At the command prompt, type:
df -h
The -h flag is for ‘human readable form’ meaning return results in the familiar megabyte/gigabyte format. You should see something like this:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/disk0s2 74G 52G 22G 70% /
@patrickgill
patrickgill / wondershare.txt
Last active May 11, 2020 18:08
wondershare alteregos
#from http://www.macworld.com/article/1153685/speaking_spammers.html
4Easysoft
4Media
4Videosoft
AirproSoft
Aimersoft
Aiseesoft
AppleXsoft
Aunsoft
@patrickgill
patrickgill / cacheclean.sh
Last active July 19, 2016 08:23
clean os x cache files
#!/bin/bash
diskutil info / | awk '/Free Space/ { print $4 $5, "free before"}'
sudo rm -rf ~/Library/Caches/*
sudo rm -rf /Library/Caches/*
sudo rm -rf /System/Library/Caches/*
diskutil info / | awk '/Free Space/ { print $4 $5, "free after"}'
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "thoughtjoy"
@patrickgill
patrickgill / Makefile
Created June 3, 2016 08:21 — forked from pklaus/Makefile
Using OpenCL on Mac OS X - Test for OpenCL Devices
dumpcl:
clang -framework OpenCL dumpcl.c -o dumpcl && ./dumpcl
@patrickgill
patrickgill / split.sh
Created June 14, 2016 17:00
split a video almost every minute into multiple parts. requires zsh
#!/bin/zsh
#$((2.77+(i*60)-0.5))
#enable brace expansion so padding 0s are added
setopt brace_ccl
for i in {05..22}
do ffmpeg -i s07e21.mkv -acodec copy -ss $(((i*59.5)+2.77)) -t 00:01:00 pt_$i.mp4
done
@patrickgill
patrickgill / framecount.sh
Created June 14, 2016 17:01
count a video frames. requires ffprobe
#!/bin/bash
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 $1