Skip to content

Instantly share code, notes, and snippets.

@BrendonKoz
BrendonKoz / leaflet-darkmode.md
Last active September 25, 2024 19:25
Automatic Dark Mode for Leaflet.js
// Leaflet JS - note the *className* attribute
// [...]

L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
    className: 'map-tiles'
}).addTo(map);

// [...]
@BrendonKoz
BrendonKoz / auto-caption-tools.md
Last active August 14, 2023 13:28
Automatic Captioning Tools
@BrendonKoz
BrendonKoz / svg_mask.html
Created June 26, 2018 15:10
SVG Masking Example with multi-element mask
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SVG Masking Test</title>
<style>
body {
background-color: #F0F;
@BrendonKoz
BrendonKoz / sticky-footer.css
Created June 15, 2018 03:00
Simplest and most versatile "sticky footer" ever
@BrendonKoz
BrendonKoz / DeleteOldRecycleBinFiles.ps1
Created January 31, 2018 18:08
A PowerShell script for deleting files (at logoff) from the Recycle Bin after X days of sitting in the bin.
# -----------------------------------------------------------------------
#
# Author : Baldwin D.
# Description : Empty Recycle Bin with Retention (Logoff Script)
# Source : http://baldwin-ps.blogspot.be/2013/07/empty-recycle-bin-with-retention-time.html
#
# -----------------------------------------------------------------------
$Global:Collection = @()
@BrendonKoz
BrendonKoz / word_stemmer.php
Created February 16, 2017 23:19
Splits words into their base word so that matching works more fluidly in text searches.
<?php
/**
* Copyright (c) 2005 Richard Heyes (http://www.phpguru.org/)
*
* All rights reserved.
*
* This script is free software.
*/
/**
@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 / bk_autoupdate.php
Created December 22, 2015 17:57
"MUST USE" plugin. Place in wp-content/mu-plugins to assure automatic theme & plugin updates are happening.
<?php
/*
Plugin Name: Theme and Plugin Auto-Update
Description: Forces automatic updates of installed plugins and themes. Be sure to have backups running!
Version: 1.0
Author: Brendon Kozlowski
Author URI: http://www.bytekick.com
License: MIT
*/