Skip to content

Instantly share code, notes, and snippets.

View BrendonKoz's full-sized avatar

BrendonKoz BrendonKoz

View GitHub Profile
@echo off
forfiles /p "\\server\Redirect" /m "Folder Name" /s /c "cmd /c del @file /Q"
@BrendonKoz
BrendonKoz / Preferences.sublime-settings
Created December 18, 2013 17:54
Sublime Text 3 - User settings
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme",
"font_face": "Courier New",
"font_size": 10,
@BrendonKoz
BrendonKoz / mysql_increment.txt
Created October 23, 2013 21:55
A way to get the next insert ID if you are certain there won't be any conflicts (other insertions during processing) from MySQL. Source: http://stackoverflow.com/a/12500309/155421
SELECT AUTO_INCREMENT
FROM information_schema.tables
WHERE table_name = 'table_name'
AND table_schema = DATABASE( ) ;
--- or ---
$result = mysql_query("SHOW TABLE STATUS LIKE 'table_name'");
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test Image Preview Pre-Upload</title>
<style type="text/css">
form div.upload label { font-weight:bold; display:block; margin-bottom:0.25em; }
img.file-preview { border:3px solid #000; }
@BrendonKoz
BrendonKoz / 2k3_backup.bat
Created September 7, 2012 19:30
Run Windows 2k3 Server backup from batch file
REM runs a "One-Time Backup" to specific target drive from batch file
REM ...create your own backup schedule instead of Microsoft's "Windows Server Backup" forced schedules
WBADMIN START SYSTEMSTATEBACKUP -backupTarget:e: -quiet
@BrendonKoz
BrendonKoz / sleep.bat
Created September 7, 2012 19:21
Set a WinXP Computer to Sleep via a command line call
@echo off
cls
rundll32.exe powrprof.dll,SetSuspendState Sleep
exit
@BrendonKoz
BrendonKoz / polaris_to_wordpress.php
Created August 14, 2012 17:33
Script to parse a Polaris Library Systems' exported XML report of a record set in order to dynamically post to a (pre-installed) Wordpress site (as a blog post). XMLRPC must be enabled in WP Settings. Was used for monthly "new materials" posts. Adapt to y
<?php
$username = 'your_wp_username';
$password = 'your_wp_password';
$blogURI = 'http://www.example.com/wordpress/';
$ignored_categories = array('Blogroll'); //store categories to ignore in an array for easier blocking
$blogAPI = $blogURI . 'xmlrpc.php';
$data = array();
$publish = false;
@BrendonKoz
BrendonKoz / toggle_icons.au3
Created January 13, 2012 16:07
AutoIt Script to enable/disable (toggle on each run) the display of desktop icons on a Windows PC. Can be used to prevent users from clicking on programs before computer is fully loaded if run as a startup application (with a delayed timer).
Func PostMessage($hWnd, $msg, $wParm, $lParm)
Return DllCall("user32.dll", "int", "PostMessage", _
"hwnd", $hWnd, _
"int", $msg, _
"int", $wParm, _
"int", $lParm)
EndFunc ;==>PostMessage
$programManager = WinGetHandle("Program Manager");
PostMessage($programManager, 0x111, 28755, 0); Show/Hide desktop icons (0x0111 is defined as $WM_COMMAND in GUIConstants.au3)