Skip to content

Instantly share code, notes, and snippets.

View lukeawyatt's full-sized avatar
👁️‍🗨️
Pridubante ĉion

Luke Wyatt lukeawyatt

👁️‍🗨️
Pridubante ĉion
View GitHub Profile
@lukeawyatt
lukeawyatt / SiteKiosk.PreventZoom.js
Last active January 8, 2021 20:25
Application: SiteKiosk
evtid = SiteKiosk.Scheduler.AddPeriodicEvent(100, CheckZoom);
function CheckZoom() {
if (SiteKiosk.WindowList.ActiveWindow.SiteKioskWindow.OpticalZoom !== 100)
SiteKiosk.WindowList.ActiveWindow.SiteKioskWindow.OpticalZoom = 100;
}
var FormatNumberWithCommas = function(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
console.log(FormatNumberWithCommas(123456789));
# MODIFY TO YOUR SOURCE FILE EXTENSIONS
cd C:\projectdirectory
(dir -include *.cs,*.xaml -recurse | select-string .).Count
@lukeawyatt
lukeawyatt / WordPress.DynamicMetadataHeader.php
Last active January 8, 2021 20:25
Application: WordPress
<?php /** INCLUDE IN FUNCTIONS.PHP **/
function set_metadata() {
global $post;
$title = get_post_meta($post->ID, MetaTitle, true);
$keywords = get_post_meta($post->ID, MetaKeywords, true);
$description = get_post_meta($post->ID, MetaDescription, true);
if (!is_home() || !is_front_page()) {
if (!empty($title)) {
@lukeawyatt
lukeawyatt / SSRS.AdvancedSorting.txt
Last active January 8, 2021 20:25
Application: SSRS
/* Interactive Sorting Descending by Numeric */
=Fields!NumericFieldToSortBy.Value * -1
/* Interactive Sorting Descending by Date */
=DATEDIFF("d",Fields!DateFieldToSortBy.Value,Today())
/* Interactive Sorting Descending by String */
=CLNG(CSTR(ASC(UCASE(LEFT(CSTR(Fields!LastName.Value) + "@",1))))
+ CSTR(ASC(UCASE(MID(LEFT(CSTR(Fields!LastName.Value) + "@@",2),2,1))))
<!-- Inject this script into any website using your browser and click on the header to make -->
<!-- modifications to local cookies. This can be thwarted by sites which prevent inline execution -->
<h1 onClick="document.cookie='COOKIENAME=VALUE; expires=Session; path=/';">CLICK HERE TO SET</h1>
net statistics workstation
pause
SELECT percent_complete, start_time, status, command, estimated_completion_time, cpu_time, total_elapsed_time
FROM sys.dm_exec_requests;
<?php
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "" || $_SERVER['HTTPS'] == "off"){
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header('Status: 301 Moved Permanently', true);
header("Location: $redirect", true, 301);
}
?>
@lukeawyatt
lukeawyatt / Mirth.Debugging.js
Last active January 8, 2021 20:23
Application: Mirth
// WRITES TO THE MAIN LOG
logger.info('MESSAGE');
// WRITES TO THE MAIN LOG
java.lang.System.err.println("MESSAGE");