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
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace FutureState.AppCore.Pages | |
{ | |
public class SegmentTab : ContentPage | |
{ | |
private Grid _grid; |
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
// self executing function keeps code off of the global namespace. | |
(function() { | |
// initialize the namespace at the top of your very first code file. | |
var ns = {}; | |
// begin declaring some classes | |
// This class is using the OBJECT LITERAL pattern | |
ns.Class1 = { | |
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 Add-ToPath{ | |
param( | |
[parameter(Mandatory=$true,position=0)][string] $pathToAdd | |
) | |
if(-NOT ($env:path.Contains($pathToAdd))) | |
{ | |
Write-Host "Adding '$pathToAdd' to your Environment Path." | |
$env:path += ";$pathToAdd" | |
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $env:path |
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
$apiKey = "Your API Key" | |
$OctopusURL = "Your Octopus URL" | |
$Header = @{ "X-Octopus-ApiKey" = $apiKey } | |
#Getting all machines given an Environment name | |
$EnvironmentName = Read-Host 'What environment do you want to wipe out?' | |
Write-Warning "You are about to remove ALL machines from the $EnvironmentName environment." | |
$confirm = Read-Host 'Are you sure you want to continue? Y/N' |
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 Get-FullName { | |
param( | |
[parameter(position=0, parametersetname="a")] [string] $firstName, | |
[parameter(position=1, parametersetname="a")] [string] $lastName, | |
[parameter(position=0, parametersetname="b")] [hashtable] $name | |
) | |
if($PSCmdlet.ParameterSetName -eq 'b') { | |
# Doing recursion will allow for parameter validation if need be! | |
Get-FullName $name.first $name.last |
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 Add-Post { | |
param ( | |
[parameter(Mandatory=$true, Position=0)][string]$post, | |
[parameter(Mandatory=$false, Position=1)][switch]$draft | |
) | |
if(!(Assert-IsGitRepo)) { | |
throw 'you are currently not in a git repository.' | |
} | |
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
source ~/.git-completion.bash | |
source ~/.git-prompt.sh | |
alias edit='open -a visual\ studio\ code' | |
alias cd..='cd ..' | |
alias co='git checkout' | |
alias pull='git fetch;git pull' | |
alias chr='open -a Google\ Chrome' | |
alias projects='cd ~/Projects' |
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
[ | |
{ "key": "ctrl+f4", "command": "workbench.action.closeActiveEditor" } | |
] |
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
$complexObject = @{ | |
test = "test" | |
guid = [guid]::NewGuid() | |
int = [int]::MaxValue | |
str = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." | |
arr = @(1..100) | |
} | |
$complexCollection = @() | |
$sw = [System.Diagnostics.Stopwatch]::StartNew() |
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
clear | |
function Invoke-First { | |
Write-Output 'if not piped, will display before Write-Host, if piped, will display after Write-Host' | |
Write-Host 'Writes every single time invoke-first is called, but is not piped out.' | |
return 'will not display unless piped or used as a return variable' | |
} | |
function Invoke-Second { | |
param( | |
[Parameter(ValueFromPipeline=$True)] [string] $val |