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
class Program | |
{ | |
// PcQueue - demo | |
// Code copied from "C# 5.0 in a Nutshell: The Definitive Reference" by Joseph Albahari and Ben Albahari | |
// Modified by @borisbucha to efficiently support IO bound operations (simply adding TaskCreationOptions.LongRunning to consumer tasks) | |
// which sugests to scheduler to allocate dedicated thread to enqued items instead of poluting Threadpool. | |
static void Main() | |
{ | |
Console.WriteLine("press any key when ready"); | |
Console.ReadLine(); |
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
cat build_out.txt | %{switch -regex ($_) {"^err:" {write-host $_ -backgroundcolor "red"} default {write-host $_}}} |
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
function Get-GitRepoPath | |
{ | |
@( $i=0;` | |
$pwd.path -split "\\"| ` | |
%{"$(@($pwd.path -split '\\')[0..$i] -join '\')";$i++} | ` | |
? {test-path "$_\\.git"})[0] | |
} | |
function Get-GitCurrentBranch | |
{ |
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
function SelectFrom-Mssql([string] $selectQuery) | |
{ | |
. sqlcmd -S "(local)" -d `"mydb`" `-Q "SET NOCOUNT ON $selectQuery" -s "|" -W | | |
ConvertFrom-CSV -Delimiter "|" | | |
select -skip 1 | |
} | |
SelectFrom-Mssql "exec sp_who" |
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
function GetFewObjs() | |
{ | |
New-Object PSObject -p @{ | |
Name = "Bill" | |
Surname = "Gates" | |
} | |
New-Object PSObject -p @{ | |
Name = "Barack" |
NewerOlder