Skip to content

Instantly share code, notes, and snippets.

View donatj's full-sized avatar
🥽
Getting back to business

Jesse Donat donatj

🥽
Getting back to business
View GitHub Profile
@donatj
donatj / Photobooth_rebuild.sh.php
Last active October 17, 2023 05:34
Photo Booth Rebuild Shell Script - see http://donatstudios.com/Lion-Photobooth-Repair for usage.
#!/usr/bin/env php -q
<?php
/**
* Photo Booth Plist Rebuilder / Repair
* @author Jesse G. Donat <donatj@gmail.com> http://donatstudios.com
* @license http://opensource.org/licenses/mit-license.php
*/
# Update this path with your username
$libraryPath = getenv('HOME') . '/Pictures/Photo Booth Library/';
@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@donatj
donatj / ascii.php
Created November 9, 2011 22:00
Damn Simple PHP Ascii Art Generator
#!/usr/bin/php -q
<?php
if(isset($argv[1]) && strlen($argv[1])) {
$file = $argv[1];
}else{
echo 'Please Specify a File';
exit(1);
}
@donatj
donatj / matlock.php
Created February 23, 2012 20:46
Slow Query Log Parser
#!/usr/bin/php
<?php
$file = false;
$defaults = array(
'maxQueryTime' => pow(2,32),
'minQueryTime' => 0,
'maxLockTime' => pow(2,32),
'minLockTime' => 0,
'maxRowsSent' => pow(2,32),
'minRowsSent' => 0,
@donatj
donatj / mybot.rb
Created March 30, 2012 14:01
Simple IRC iTunes bot
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.server = ""
c.channels = ["#"]
c.password = ""
c.nick = ""
end
@donatj
donatj / bot.php
Created April 14, 2012 01:08
Simple IRC Bot
#!/usr/bin/php -q
<?php
include('pinch.php');
$pinch = new Pinch('irc.----.com', 'Manbot', '#channel', 'password');
$pinch->on('/:test ([a-z0-9 ]+)/i', function($msg, $obj){
$obj->msg( $msg[1], '#capdig' );
});
@donatj
donatj / brave.bas
Created April 17, 2012 14:29
Save Mel Gibsons Testicles
DECLARE SUB where (d#, pants#)
DECLARE SUB look (d#)
DECLARE SUB lookat (d#)
DIM level#(4, 4)
CLS
FOR c# = 1 TO 4
FOR b# = 1 TO 4
level#(b#, c#) = a#
a# = a# + 1
NEXT
@donatj
donatj / debug.css
Created April 20, 2012 21:38
Pure CSS Debuggery
*[class]:before {
position: absolute;
background: rgba(10,10,10,.6);
padding: 10px;
border-radius: 4px;
color: white;
font-size: 10px;
display: block;
content: "[" attr(class) "] " ;
}
@donatj
donatj / chrome.js
Created June 29, 2012 20:27
Google Chrome on iPad
javascript:location.href='googlechrome://'+location.host+location.pathname;
@donatj
donatj / compat.rb
Created August 7, 2012 13:04
Open Directory Downloader
class Dir
class << self
def exists? (path)
File.directory?(path)
end
alias_method :exist?, :exists?
end
end