Skip to content

Instantly share code, notes, and snippets.

View Geertvdc's full-sized avatar
🌩️
Build it, Run it, Break it, Fix it, Own it!

Geert van der Cruijsen Geertvdc

🌩️
Build it, Run it, Break it, Fix it, Own it!
View GitHub Profile
Param(
[String]$projectFolder,
[String]$buildId
)
if (-Not $projectfolder) {
Write-Host "no project folder set"
exit 1
}
@Geertvdc
Geertvdc / ZipAppxPackage.ps1
Last active February 26, 2016 15:17
Create a zip file from UWP appxPackage folder
Param(
[string]$dir
)
function ZipFiles( $zipfilename, $sourcedir )
{
Add-Type -Assembly System.IO.Compression.FileSystem
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourcedir,
@Geertvdc
Geertvdc / UploadUWPToHockeyapp.ps1
Created February 26, 2016 15:14
Powershell script to upload UWP .zip packages to hockeyapp for deployment
Param(
[string]$HockeyAppAppID,
[string]$HockeyAppApiToken
)
$zipFile = Get-Item *.zip | Select-Object -first 1
Write-Host "Zip file found to upload $($zipFile)"
$create_url = "https://rink.hockeyapp.net/api/2/apps/$HockeyAppAppID/app_versions/new"
@Geertvdc
Geertvdc / NugetRestore.sh
Created March 7, 2016 13:55
Bash script to restore nuget packages on a Mac
sln="$1"
curl -s -O https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe
mono nuget.exe restore "$sln"
<Pivot Title="Pivot">
<Pivot.Resources>
<DataTemplate x:Key="EmptyHeaderTemplate">
<Grid />
</DataTemplate>
<Style x:Key="NoHeaderPivotStyle"
TargetType="Pivot">
<Setter Property="Margin"
Value="0" />
<Setter Property="Padding"
//Realm
_realm.Write(() =>
{
for (int i = 0; i < 1000; i++)
{
var order = _realm.CreateObject<RealmOrder>();
order.OrderNumber = $"Order{i}";
order.Price = i;
order.Title = Title = $"title {i}";
//Realm sample queries
var realmOrders = _realm.All<RealmOrder>().Where(o => o.Price >= 900).ToList();
var realmOrderLines = _realm.All<RealmOrderLine>().Where(l => l.Amount == 2).ToList();
//Sqlite generic query
public async Task<List<T>> Query<T>(Expression<Func<T,bool>> query) where T : class
{
return await sql.GetAllWithChildrenAsync<T>(query);
}
@Geertvdc
Geertvdc / azuredeploy.json
Created November 5, 2016 22:59
Deploy Web app + App service plan to Application Service Environment in other subscription in enterprise agreement
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"TmpAppPlanInASEName": {
"type": "string",
"minLength": 1
},
"appServiceEnvironmentName": {
"type": "string",
Trace-VstsEnteringInvocation $MyInvocation
$fileUrl = Get-VstsInput -Name fileUrl -Require
$sitecoreUrl = Get-VstsInput -Name sitecoreUrl -Require
Write-Host "Sitecore URL $sitecoreUrl"
Write-Host "file URL $fileUrl"
Write-Host "create httpclient"
Feature: Serve coffee
Coffee should not be served until paid for
Coffee should not be served until the button has been pressed
If there is no coffee left then money should be refunded
Scenario: Buy last coffee
Given there are 1 coffees left in the machine
And I have deposited 1$
When I press the coffee button
Then I should be served a coffee