Skip to content

Instantly share code, notes, and snippets.

Avatar
Caffeinating in a Hybrid Way

Jesse Donat donatj

Caffeinating in a Hybrid Way
View GitHub Profile
View Application.xaml.vb
Imports System.Windows.Shell
Class Application
Public Sub New()
Dim jl As New JumpList
JumpList.SetJumpList(Application.Current, jl)
Dim SaveAs As New JumpTask
SaveAs.ApplicationPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
@donatj
donatj / penny-arcade-line-height.user.js
Created May 31, 2011
Penny Arcade Line-Height User Script
View penny-arcade-line-height.user.js
// ==UserScript==
// @name Penny Arcade Line-Height Correction
// @author Jesse G. Donat
// @namespace http://donatstudios.com/
// @match http://www.penny-arcade.com/*
// @description Fixes Penny-Arcades stupid unreadable lineheight
// ==/UserScript==
document.getElementsByClassName('body')[0].style.lineHeight='1.6em';
View Photobooth_rebuild.sh.php
#!/usr/bin/php -q
<?php
/**
* Lion Photo Booth Plist Rebuilder / Repair
* @author Jesse G. Donat <donatj@gmail.com> http://donatstudios.com
*/
# Update this path with your username
$library_path = getenv('HOME') . '/Pictures/Photo Booth Library/';
@donatj
donatj / mybot.rb
Created Mar 30, 2012
Simple IRC iTunes bot
View mybot.rb
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.server = ""
c.channels = ["#"]
c.password = ""
c.nick = ""
end
@donatj
donatj / bot.php
Created Apr 14, 2012
Simple IRC Bot
View bot.php
#!/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 Apr 17, 2012
Save Mel Gibsons Testicles
View brave.bas
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 / chrome.js
Created Jun 29, 2012
Google Chrome on iPad
View chrome.js
javascript:location.href='googlechrome://'+location.host+location.pathname;
@donatj
donatj / compat.rb
Created Aug 7, 2012
Open Directory Downloader
View compat.rb
class Dir
class << self
def exists? (path)
File.directory?(path)
end
alias_method :exist?, :exists?
end
end
@donatj
donatj / mblen.php
Last active Oct 15, 2015
Gets byte length of characters read from stdin
View mblen.php
#!/usr/bin/env php
<?php
mb_internal_encoding('UTF-8');
$string = '';
if( count($argv) > 1 ) {
$string .= implode(' ', array_slice($argv, 1));
} else {
while( $line = fgets(STDIN) ) {
@donatj
donatj / FixITunesPlayedCount.applescript
Created Nov 11, 2015
Fixes tracks with a last played but no played count.
View FixITunesPlayedCount.applescript
tell application "iTunes"
(* this prevents an error on no tracks being found on the set below *)
set played count of first track where played count = 1 to 0
(* sometimes it leaves this if we don't wait *)
delay 1
set played count of every track where played count = 0 and played date ³ (date "Thursday, June 1, 2000 at 12:00:00 AM") to 1
end tell