This file contains 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
function topazSigString2svg(SigString: string): SVGSVGElement { | |
let raw = Buffer.from(SigString, "hex").toString(); // Convert Hex | |
raw = raw.replace(/\r|\\r/g, ""); // Fix: remove '\r' occurrences because Windows | |
const arr = raw.split(/\r?\n/); // Split into array | |
if (parseInt(arr[1]) > 0) { | |
// Check if signature is empty | |
const coords = arr.slice(2, parseInt(arr[0]) + 2), // Separate coordinate pairs | |
lines = arr.slice(parseInt(arr[0]) + 2, parseInt(arr[1]) + parseInt(arr[0]) + 2), // Separate number of coordinate pairs per stroke |
This file contains 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
//You must first install the vis and react types 'npm install --save-dev @types/vis @types/react' | |
declare module "react-graph-vis" { | |
import { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis"; | |
import { Component } from "react"; | |
export { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis"; | |
export interface graphEvents { | |
[event: NetworkEvents]: (params?: any) => void; | |
} |
This file contains 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
#In Powershell. | |
# Install chocolatey https://chocolatey.org/install to be the software package manager. Right now the following line is the installer. But it would be good to go grab the new command from the site provided. | |
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install git ghostscript xpdf-utils gnuwin 7zip cyg-get msys2 graphviz activeperl | |
choco install ruby --version=2.6.5.1 | |
# This sets up ruby to be a dev kit | |
ridk install 1 | |
cyg-get install catdoc unrtf unzip antiword xlsx2csv libvisio-tools |
This file contains 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
# An Home Assistant (home-assistant.io) service to component lights that accept RGB, XY or MIREDS color commands. | |
# v20170311 -- https://gist.github.com/xlcnd/01b2d8a28d9d77af901840072360a434 | |
# Original by 2017 Alexandre Conde <xlcnd@outlook.com> https://gist.github.com/xlcnd/01b2d8a28d9d77af901840072360a434 | |
# Edited by Chad Petersen July 2018 | |
# Licensed under MIT | |
# INSTALL: | |
# 1. Create the file <config dir>/custom_components/circadian_lights.py and copy the code below to there. | |
# 2. In your <config dir>/configuration.yaml enter (adapt to your case): | |
# circadian_lights: | |
# calmdown: '22:00:00' |
This file contains 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
CREATE TABLE #UniqueColumns ( | |
schemaName NVARCHAR(MAX), | |
tableName NVARCHAR(MAX), | |
columnName NVARCHAR(MAX) | |
); | |
DECLARE @unique BIT, | |
@checkSQL NVARCHAR(MAX), | |
@sName NVARCHAR(MAX), | |
@tName NVARCHAR(MAX), | |
@cName NVARCHAR(MAX); |
This file contains 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
--Chad J Petersen | |
--April 2, 2015 | |
--Microsoft TSQL (transact SQL) 2008 R2 | |
--offset/scramble Selected rows in a DB by a random number. | |
--add values to the @dictionary values to scramble columns with that name everywhere in the DB. | |
--UNAVOIDABLE RESTRAINT:: WILL BREAK IF A TABLE THAT NEEDS SCRAMBLING HAS MORE THAN (9,023,372,036,854,775,807) ROWS; | |
--PARAMETERS |