Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
pawelpabich / Function.cs
Last active Oct 16, 2019
Stateless function
View Function.cs
#Defintion
public static class SetServerUrl
{
public static Task Run(paramters)
{
//Body
}
}
View ProvisionInstance.ps1
param([string] $VirtualMachineFullDNSName, [string] $ConnectionString, [string] $AdministratorPassword, [string] $EncodedLicense, [string] $StoragePath, [string] $InstanceName, [Int] $ServerCommPort)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
function Log($Message)
{
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss,fff"
$newLine = [System.Environment]::NewLine
$logEntry = "$timestamp $Message $newLine"
View InstallServer.ps1
param([string] $Version, [string] $StorageAccount, [string] $StorageUser, [string] $StoragePassword)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
New-Item -ItemType Directory -Force -Path C:\Temp
function Log($Message)
{
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss,fff"
View azurepoc.ps1
param([string] $IpAddress, [string] $ConnectionString, [string] $AdministratorPassword, [string] $EncodedLicense, [string] $StoragePath, [string] $StorageAccount, [string] $StorageUser, [string] $StoragePassword)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
function Log($Message, $IncludeTimestamp)
{
$logEntry = $Message
if ($IncludeTimestamp)
View VSError
=====================
18/05/2018 9:44:40 AM
LimitedFunctionality
System.AggregateException: Project system data flow 'OutputGroupsService Outer 84518' closed because of an exception: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.ProjectServices.DesignTimeBuilder.<BuildAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
View pac
function FindProxyForURL(url, host)
{
return "PROXY localhost:8888";
}
@pawelpabich
pawelpabich / Get-Events.ps1
Last active Mar 23, 2017
Gets events related to variable sets
View Get-Events.ps1
param($OctopusServerUrl, $OctopusServerApiKey, $OutputFile, $DateFrom, $DateTo)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
$Server = @{ OctopusServerUrl = $OctopusServerUrl; OctopusServerApiKey = $OctopusServerApiKey}
function Get-Data($Path)
{
$Path = $Path.Replace("api/", "")
View Migration.sql
UPDATE [dbo].[Deployment]
SET JSON = REPLACE(JSON, '"$type":"Octopus.Server.Orchestration.Deploy.DeploymentState, Octopus.Server",','')
WHERE JSON LIKE '%"$type":"Octopus.Server.Orchestration.Deploy.DeploymentState, Octopus.Server",%'
GO
View keybase.md

Keybase proof

I hereby claim:

  • I am pawelpabich on github.
  • I am pawelpabich (https://keybase.io/pawelpabich) on keybase.
  • I have a public key whose fingerprint is 112D 7AE2 27E4 1D5D 690E 79C4 8418 0402 7F37 D6A3

To claim this, I am signing this object:

View SampleFSharp
let value =
match "MyVariableName" |> Octopus.tryFindVariable with
| Some x -> x
| None -> "not available"
printfn "Hello %s" value
You can’t perform that action at this time.