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
param([String]$key) | |
Get-ChildItem .\*.config -Recurse | | |
Where-Object { ([xml](Get-Content $_)).SelectSingleNode("//add[@key='$key']") } | | |
ForEach-Object { | |
$xml = [xml](Get-Content $_) | |
$xml.SelectSingleNode("//add[@key='$key']").Value | |
} |
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
<# | |
Powershell DSC resources for setting up an imaging network, based on the PSAutoLab PowerShelllab network | |
#> | |
Configuration ImagingLab | |
{ | |
Import-DscResource -ModuleName PSDesiredStateConfiguration -ModuleVersion 1.1 | |
Import-DscResource -ModuleName ComputerManagementDSC -ModuleVersion 8.5.0 | |
Import-DscResource -ModuleName NetworkingDSC -ModuleVersion 8.2.0 | |
Import-DscResource -ModuleName xNetworking | |
Import-DscResource -ModuleName DSCR_FileContent -ModuleVersion 2.4.2 |
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
def date_from_workday(workday_num): | |
return datetime.strptime(f"2021-W{workday_num//5+1}-{workday_num%5+1}", '%Y-W%W-%w') | |
def generate_session_dates(session_count=15, start_workday=None): | |
session_dates = [] | |
session_workday = start_workday if start_workday else randint(0,200) | |
for n in range(session_count): | |
session_dates.append(date_from_workday(session_workday)) | |
session_workday += 1 if randint(0,5) else 2 | |
return session_dates |
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
gci . |?{$_.PSIsContainer}|?{Test-Path $_\.git}|foreach {pushd $_; git status; popd} |
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
Get-WmiObject -Class Win32_Product | ?{$_.Name -like "Python 3.*" | Format-Table | |
Get-WmiObject -Class Win32_Product | ?{$_.Name -like "Python 3.*" | foreach {$_.Uninstall()} |
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
pragma solidity ^0.5.12; | |
contract PhotoContestContract { | |
bytes32 _name; | |
address _owner; | |
bytes32[] _ipfsPhotoHashes; | |
address payable[] _submissionAddresses; | |
constructor(bytes32 name) public { | |
_owner = msg.sender; | |
_name = name; |
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
pragma solidity ^0.4.17; | |
contract Contract { | |
string ipfsHash; | |
function setHash(string x) public { | |
ipfsHash = x; | |
} | |
function getHash() public view returns (string x) { | |
return ipfsHash; | |
} | |
} |
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
string source = string.Format(@" | |
using System.ServiceModel; | |
namespace CreateTypeForSvcNamespace | |
{{ | |
[ServiceContract(Namespace=""{0}"",Name=""{1}"")] | |
public interface {1} {{ }} | |
}}", ns, name); | |
var asmName = Path.GetRandomFileName(); | |
var compilation = CSharpCompilation.Create(asmName, |
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
findstr /S/R "public.interface" *.cs |
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
findstr /S "version" config |
NewerOlder