Skip to content

Instantly share code, notes, and snippets.

# Import CSVs
$csv1 = Import-CSV -Path c:\temp\csv1.csv
$csv2 = Import-CSV -Path c:\temp\csv2.csv
# Loop through each item in csv1
foreach ($item in $csv1) {
$thisDataType = $item.DataType
# find the entry in csv2 where csv2's column name matches this column name
function Benchmark-Command ([ScriptBlock]$Expression, [int]$Samples = 1, [Switch]$Silent, [Switch]$Long) {
<#
.SYNOPSIS
Runs the given script block and returns the execution duration.
Hat tip to StackOverflow. http://stackoverflow.com/questions/3513650/timing-a-commands-execution-in-powershell
.EXAMPLE
Benchmark-Command { ping -n 1 google.com }
#>
$timings = @()
function Benchmark-Command ([ScriptBlock]$Expression, [int]$Samples = 1, [Switch]$Silent, [Switch]$Long) {
<#
.SYNOPSIS
Runs the given script block and returns the execution duration.
Hat tip to StackOverflow. http://stackoverflow.com/questions/3513650/timing-a-commands-execution-in-powershell
.EXAMPLE
Benchmark-Command { ping -n 1 google.com }
#>
$timings = @()
@pezhore
pezhore / dhtsend.sh
Last active July 27, 2016 15:24
Simple bash script that will poll for data on a DHT22 sensor and push to a Domoticz system
#!/bin/bash
# Domoticz server
SERVER="localhost:8080"
# IDX DHT
# The number of the IDX in the list of peripherals
DHTIDX="4"
#DHTPIN
### Keybase proof
I hereby claim:
* I am pezhore on github.
* I am pezhore (https://keybase.io/pezhore) on keybase.
* I have a public key whose fingerprint is 2FF3 6582 9C22 8182 C352 C5E6 9385 92BE 8CA2 02E8
To claim this, I am signing this object: