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
{ | |
"globals": { | |
"alwaysShowTabs": true, | |
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44b0}", | |
"initialCols": 160, | |
"initialRows": 50, | |
"keybindings": [ | |
{ | |
"command": "closePane", | |
"keys": [ |
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
-HttpPipelineAppend { param($req, $callback, $next ) | |
Write-Host -fore white "Inserted my code in the http pipeline on the way to:`n $($req.RequestUri)." | |
Write-Host -fore yellow "`n---------------------`n Before We Go!`n---------------------" | |
Write-host -fore white "Request Headers:"; | |
$($req.Headers) |% { if ($_.Key -ne "Authorization") { Write-host -nonewline -fore cyan " $($_.Key): "; Write-Host -fore green "$($_.Value)" } } | |
# call the next step in the Pipeline |
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
Set-ExecutionPolicy -Scope LocalMachine Unrestricted -force | |
$ProgressPreference=0 | |
function ResolvePath { | |
param ( | |
[string] $FileName | |
) | |
$FileName = Resolve-Path $FileName -ErrorAction SilentlyContinue ` | |
-ErrorVariable _frperror |
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
<# | |
.SYNOPSIS | |
Creates a new alias. Better than original New-Alias | |
.DESCRIPTION | |
Creates a new Function Alias. Unlike the original New-Alias, this will let you | |
create an alias that can be a command line or script, in a single command. |
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
#pragma once | |
#include "device.h" | |
// this device represents a switch that can be open or closed. | |
class Switch : public Device { | |
protected: | |
// the pin the switch is connected to. | |
const uint8_t pin; | |
public: |
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
#pragma once | |
#include "device.h" | |
// our Blinker class, just blinks a light on and off on continually. | |
class Blinker : public Device { | |
private: | |
bool state = false; | |
public: | |
// constructor -- pass in the interval for flipping the light. |
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
// Setup the sketch. | |
void setup() { | |
// we're going to spit some messages out to the serial port. | |
Serial.begin(19200); | |
// create the device instances | |
// blink on and off every two seconds. | |
bc = new Blinker(2000); | |
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
// include references to the devices that we'd like to use | |
#include "blinker.h" // an automated blinker | |
#include "switch.h" // a device that supports events for a switch (ie, closed, open) | |
#include "freeMemory.h" // an automated poller that reports teh free memory back to the serial console. | |
// Handy for debugging and seeing how much memory is getting sucked up. | |
// First, declare the states we want in our state machine: | |
States( starting, processing, cleanup ); // these can be anything you'd like. |
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
// the setup function runs once when you press reset or power the board | |
void setup() { | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second |
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-Redis -HttpPipelineAppend { param($req, $callback, $next ) | |
Write-Host -fore white "Inserted my code in the http pipeline on the way to:`n` $($req.RequestUri)." | |
Write-Host -fore yellow "`n---------------------`n Before We Go!`n---------------------" | |
Write-host -fore white "Request Headers:"; | |
$($req.Headers) |% { if ($_.Key -ne "Authorization") { Write-host -nonewline -fore cyan " $($_.Key): "; Write-Host -fore green "$($_.Value)" } } | |
# call the next step in the Pipeline |