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
import unittest | |
class testSomething(unittest.TestCase): | |
def testSomethingSpecific(self): | |
self.assertTrue(True) |
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
$logFile = ".\MyLogFile.log" | |
$ErrorActionPreference = "SilentlyContinue" | |
Stop-Transcript | Out-Null | |
$ErrorActionPreference = "Continue" | |
Start-Transcript -path $logFile | |
# Do Stuff | |
# If running commands with & some.exe pipe to Out-Default | |
& some.exe | Out-Default |
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]$requiredParam = $(throw "-requiredParam FOO|BAR is expected"), | |
[string]$optionalParam = "DefaultValue" | |
) |
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
@echo off | |
SET DIR=%~dp0% | |
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "& '%DIR%MyScript.ps1' %*" | |
pause |
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
public string GetPassword() | |
{ | |
Console.Write("Enter password: "); | |
var password = new StringBuilder(); | |
while (true) | |
{ | |
var readKey = Console.ReadKey(true); | |
if (readKey.Key == ConsoleKey.Enter) | |
{ | |
Console.Write("\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
$password = Read-Host -assecurestring "Please enter the password" | |
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password)) |
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
# Rename *.log files to be prefixed with YYYYmmdd- and upload to an S3 bucket | |
# Author: James Strassburg <[email protected]> | |
$bucketName = "myS3bucket" | |
$sourceLogs = "\\myfileserver\mylogdir" | |
$logFilter = "*.log" | |
$date = Get-Date -UFormat "%Y%m%d" | |
$bucket = Get-S3Bucket -BucketName $bucketName | |
if ($bucket -eq $null) | |
{ |
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
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
<!-- only the relevant addition is listed here --> | |
<Call name="addBean"> | |
<Arg> | |
<New class="org.eclipse.jetty.security.HashLoginService"> | |
<Set name="name">MySolrRealm</Set> | |
<Set name="config"> |
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
colorscheme koehler | |
set number | |
set ignorecase | |
set shiftwidth=4 softtabstop=4 | |
set autoindent smartindent | |
set smarttab | |
set foldmethod=indent foldlevel=99 | |
filetype indent plugin on | |
syntax on | |
map <F1> :!git status<ENTER> |
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
[CommandLineArguments(Program = "MyProgram", Title = "MyProgramTitle", Description = "My awesome program")] | |
internal class Arguments | |
{ | |
[CommandLineParameter(Command = "?", Default = false, Description = "Show help", Name = "Help", IsHelp = true)] | |
public bool Help { get; set; } | |
[CommandLineParameter(Name = "requiredParameter", ParameterIndex = 1, Required = true, | |
Description = "This parameter is required")] | |
public string RequiredParameter { get; set; } | |
OlderNewer