.
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
| SELECT TOP(100) t.[name], c.TestA, c.TestB | |
| FROM sys.tables t | |
| CROSS APPLY ( | |
| SELECT TestA = STRING_AGG(c.[name], '_') | |
| , TestB = STRING_AGG(c.[name], ',') | |
| FROM sys.columns c | |
| WHERE c.[object_id] = t.[object_id] | |
| ) c | |
| WHERE t.is_ms_shipped = 1 | |
| ORDER BY t.[object_id] |
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
| # gist - https://gist.github.com/chadbaldwin/1a486b4fbf48e9b0cd9551cb7e16382a | |
| <# Docs: | |
| https://hub.docker.com/_/microsoft-mssql-server | |
| https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-environment-variables | |
| #> | |
| # Start SQL Server docker instance | |
| Write-Verbose 'Creating function: Start-SQLServer' | |
| function Start-SQLServer { | |
| [CmdletBinding()] |
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
| tts: | |
| - platform: google_translate | |
| template: | |
| - binary_sensor: | |
| - name: garage_open_no_motion | |
| state: > | |
| {{ | |
| (is_state('binary_sensor.contact_7_contact', 'on')) | |
| and |
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
| alias: Garage Door Open Notification | |
| description: Send out repeating notifications or announcements that the garage door is left open | |
| mode: restart | |
| trigger: | |
| - platform: state | |
| entity_id: | |
| - group.garage_motion | |
| - binary_sensor.contact_7_contact | |
| condition: | |
| - condition: state |
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
| If you try to add a space to the name in GitHub, it gets trimmed. | |
| If you try to add a space to the name in Windows, it gets trimmed. | |
| The best option seems to be to add the file via command line with the space in the name, then commit and push. |
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
| $string = 'Functions' | |
| $result = foreach ($l in '','*','/','*/','**/') { | |
| foreach ($r in '','*','/','/*','/**') { | |
| $glob = "!${l}${string}${r}" | |
| $stat = Measure-Command { $list = rg --files -g "${glob}" } | |
| [pscustomobject]@{ | |
| Glob = $glob | |
| Count = $list.Count | |
| ExecTimeMS = $stat.Milliseconds |
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
| # configuration.yaml | |
| template: | |
| - sensor: | |
| - name: new_entity_id | |
| device_class: power | |
| unit_of_measurement: W # watts | |
| state: "{{ states('sensor.target_entity_id') | default(0, true) | round(2, default=0) }}" | |
| # customize.yaml | |
| sensor.new_entity_id: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| IF OBJECT_ID('tempdb..#gaps','U') IS NOT NULL DROP TABLE #gaps; --SELECT * FROM #gaps | |
| CREATE TABLE #gaps ( | |
| ID int NOT NULL IDENTITY, | |
| Val int NOT NULL, | |
| ); | |
| DECLARE @repeat int, @randval int, @sql nvarchar(MAX); | |
| DECLARE @c int = 1000; -- How many islands to create | |
| WHILE (@c > 0) | |
| BEGIN; |