Skip to content

Instantly share code, notes, and snippets.

View josheby's full-sized avatar

Josh Eby josheby

  • Michigan
View GitHub Profile
[alias]
ci = commit
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
lol = log --graph --decorate --pretty=format:\"%h %ad | %s%d [%an]\" --date=short --abbrev-commit
# View the current working tree status using the short format
@josheby
josheby / snapshot.bat
Last active November 30, 2016 15:51
Automatic Hard Drive Snapshots to Drobo Using DriveSnapshot
@echo off
cd "C:\Scripts"
net use Z: \\SE-DROBO\SE-BACKUP /user:backup YourPasswordHere
snapshot C:+D: Z:\Snapshot-$date-$disk.sna -L0 -R -T -W --UseVSS --LogFile:C:\Scripts\snapshot.log
forfiles /p Z:\ /s /m *.* /d -30 /c "cmd /c del @path"
@josheby
josheby / .htaccess
Created March 14, 2016 23:15
Nested WordPress Networks Using WP Multi Network
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)+?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
@josheby
josheby / custom_media_menu.js
Created March 4, 2016 18:04 — forked from Fab1en/custom_media_menu.js
Draft plugin example to add a javascript menu into the WP3.5 Media Library popup. Answer to this Wordpress stackexchange question : http://wordpress.stackexchange.com/questions/76980/add-a-menu-item-to-wordpress-3-5-media-manager/
// for debug : trace every event
/*var originalTrigger = wp.media.view.MediaFrame.Post.prototype.trigger;
wp.media.view.MediaFrame.Post.prototype.trigger = function(){
console.log('Event Triggered:', arguments);
originalTrigger.apply(this, Array.prototype.slice.call(arguments));
}*/
// custom state : this controller contains your application logic
wp.media.controller.Custom = wp.media.controller.State.extend({