This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hubitat UI enhancements | |
// @description Hubitat UI enhancements. This is a fork from https://github.com/surfingbytes/hubitat/blob/master/hubitat-ui-enhancements.js. All credit goes to surfingbytes. For more information see this post: https://community.hubitat.com/t/ui-enhancements/89773 | |
// @version 1.2 | |
// @grant unsafeWindow | |
// @include http://192.168.0.100/* | |
// @require https://code.highcharts.com/stock/highstock.js | |
// @require https://code.highcharts.com/stock/modules/data.js | |
// @require https://code.highcharts.com/stock/highcharts-more.js | |
// @require https://code.highcharts.com/stock/modules/exporting.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#script to take a source dir and organize photos from that dir into a dest dir with a hierarchy of year/month/photo_name | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "Usage: processPhotos.sh {input folder}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#https://gist.github.com/howellcc/70f5c45a9902f9a3fe4e566ceedf1bca | |
#This is a backup script that I'm running on my Synology NAS to back up my Hubitat Elevation. | |
he_login=[Hubitat Username] | |
he_passwd=[Hubitat Password] | |
he_ipaddr=[Hubitat IP Address] | |
backupdir='[Backup Location]' #no trailing space | |
hubname='Hubitat' #in case you have multiple hubs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = $False} } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script creates a series of text files and back-dates the createTime, modifiedTime and accessedTime. | |
# I wrote it to test deleting of files X number of days old. It creates the following files: | |
# 1days.txt - which is 1 day old | |
# 2days.txt - which is 2 days old | |
# .... you get the idea. | |
$destfolder = "C:\Users\{username}\temp"; | |
$numFilesToCreate = 500; | |
For($i=1; $i -le $numFilesToCreate; $i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Path .\ -Recurse | ForEach-Object { $_.FullName } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I added this to task scheduler | |
#Triggers: on Login and on unlock | |
#action: Powershell.exe | |
#action Arguments: -ExecutionPolicy Bypass {PATH}\NumLockFix.ps1 | |
if(-not [console]::NumberLock){ | |
$w = New-Object -ComObject WScript.Shell; | |
$w.SendKeys('{NUMLOCK}'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Private Property With Public Accessor</Title> | |
<Shortcut>proppriv</Shortcut> | |
<Description>Code snippet for a private property with a public accessor.</Description> | |
<Author>howellcc</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Property With Change Event</Title> | |
<Shortcut>propn</Shortcut> | |
<Description>Code snippet for property that calls RaisePropertyChanged and XML description</Description> | |
<Author>howellcc</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static byte[] RotateImageByExifData(byte[] imgDataBytes, bool updateExifData = true) | |
{ | |
try | |
{ | |
using(MemoryStream origImageStream = new MemoryStream(imgDataBytes)) | |
{ | |
using(MemoryStream rotatedImageStream = new MemoryStream()) | |
{ | |
using(Image image = Image.FromStream(origImageStream, false, false)) | |
{ |