Skip to content

Instantly share code, notes, and snippets.

@joshhartman
joshhartman / .htaccess
Last active November 16, 2018 18:44
Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
@dbirks
dbirks / change-last-logged-on-user-windows-10.md
Last active February 26, 2024 13:00
Change last logged on user on Windows 10

In Windows 10 you can no longer change the last logged on user in the registry like you could in Windows 7. Windows 10 requires the user's SID to be entered as well. Here's an updated guide.

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI, you'll want to change 4 entries:

  • LastLoggedOnDisplayName
    • Enter the user's full name, like Allan Jude
  • LastLoggedOnSAMUser
    • Enter the username, like SHORTDOMAIN\allan.jude
  • LastLoggedOnUser
  • Enter the username again, like SHORTDOMAIN\allan.jude
@rniswonger
rniswonger / wp-disable-plugin-update.php
Last active January 3, 2024 15:21
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@chetan
chetan / fix_roaming_profile_perms.bat
Created September 12, 2012 03:41
Fix permissions on a roaming profile folder
REM usage: fix_perms.bat <username>
REM Recursively assign ownership to Administrators. Answer prompts with "Y".
takeown /R /A /F %1 /D Y
REM Grant Full permissions on folder and subfolders to Administrators, SYSTEM, and the user
cacls %1 /T /E /P "Administrators":F
cacls %1 /T /E /P SYSTEM:F
cacls %1 /T /E /P %1:F
REM Set owner back to UserName
subinacl.exe /noverbose /subdirectories %1\*.* /setowner=%1
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array