Skip to content

Instantly share code, notes, and snippets.

View robdmoore's full-sized avatar

Rob Moore (MakerX) robdmoore

View GitHub Profile
@robdmoore
robdmoore / gist:efd01bd380c3c90ef3c3
Created August 31, 2014 07:03
XDT Transformation to add custom error page URLs to an ASP.NET application.
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Replace" xdt:Transform="Insert">
<remove statusCode="404" />
<error statusCode="404" path="/error/404" responseMode="ExecuteURL" />
<remove statusCode="500" />
<error statusCode="500" path="/error/500" responseMode="ExecuteURL" />
<remove statusCode="403" />
<error statusCode="403" path="/error/403" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
@robdmoore
robdmoore / gist:f82d74d4c377d4f3755e
Created August 31, 2014 06:14
List all documents in an Azure DocumentDB Document Collection
class Program
{
static void Main(string[] args)
{
Task.WaitAll(new[] {DoStuff()});
}
private static async Task DoStuff()
{
var client = new DocumentClient(new Uri("https://<documentdbtenant>.documents.azure.com:443/"),
@robdmoore
robdmoore / Add-ToHostsFile.ps1
Created July 23, 2014 08:17
Script to set up ASP.NET development environment in IIS with SQL Express using Network Service
# Originally from http://poshcode.org/3819
function Add-ToHostsFile {
<#
.DESCRIPTION
This function checks to see if an entry exists in the hosts file.
If it does not, it attempts to add it and verifies the entry.
.EXAMPLE
Add-ToHostsFile -IPAddress 192.168.0.1 -HostName MyMachine
@robdmoore
robdmoore / setup-cordova-phonegap.ps1
Last active September 13, 2023 16:04
Scripted/Automated installation script to set up Cordova/PhoneGap and Android on Windows
# Run this in an elevated PowerShell prompt
<# This script worked on a fresh Windows Server 2012 VM in Azure and the following were the latest versions of each package at the time:
* Chocolatey 0.9.8.27
* java.jdk 7.0.60.1
* apache.ant 1.8.4
* android-sdk 22.6.2
* cordova 3.5.0-0.2.6
* nodejs.install 0.10.29
#>
# Note: there is one bit that requires user input (accepting the Android SDK license terms)
@robdmoore
robdmoore / gist:3b260de9aa066f332537
Last active March 29, 2021 18:36
Instructions for updating .mobileprovisioning file for over-the-air .ipa deployments for Beta testing
  1. A user needs to supply their device UDID (http://whatsmyudid.com/)
  2. Log into iOS developer centre (https://developer.apple.com/devcenter/ios/index.action)
  3. Click on Certificates, Identifiers & Profiles
  4. Click on Devices
  5. Click add
  6. Add the device UUID
  7. Click on Distribution under Provisioning Profiles
  8. Click on Beta testing (assuming that's what you called it)
  9. Click Edit
  10. Tick all the devices that you want to be allowed for Over The Air
@robdmoore
robdmoore / _readme.md
Last active August 29, 2015 14:04
OctopusDeploy NuGet package contents that were used to deploy iOS over-the-air ipa and build iOS and Android via PhoneGapBuild

The following files were included in a NuGet package that we used OctopusDeploy to deploy an iOS over-the-air .ipa file and also build a Cordova/PhoneGap app using the PhoneGapBuild API:

@robdmoore
robdmoore / _readme.md
Last active October 8, 2022 13:57
HelloWorld Cordova and PhoneGap app differences

The _'s in the file names are representative of a folder path.

The following is the console output of how these files were generated:

C:\Windows\system32>cordova -v
3.5.0-0.2.6

C:\Windows\system32>phonegap -v
3.5.0-0.20.7
@robdmoore
robdmoore / _readme.md
Last active April 12, 2018 08:57
NodeJS Script to automate deployment of Cordova/PhoneGap application using PhoneGapBuild

pgb-wrapper.js is a generic wrapper module around the phonegap-build-api NodeJS package to add promise support and some helpful functions to make it easier to create a build script.

pgb.example.js is one example of such a build script, but you might decide to do it differently.

You can execute pgb.example.js by:

node pgb.example.js --appId {PGB_APP_ID} --apiKey {PGB_API_KEY} --zipFile {path/to/deployment_file.zip} --iosOverTheAirKey {NAME_OF_IOS_OVER_THE_AIR_KEY_IN_PGB} --iosOverTheAirKeyPassword {PASSWORD_OF_IOS_OVER_THE_AIR_KEY_IN_PGB} --iosKey {NAME_OF_IOS_PRODUCTION_KEY_IN_PGB} --iosKeyPassword {PASSWORD_OF_IOS_PRODUCTION_KEY_IN_PGB} --androidKey {NAME_OF_ANDROID_PRODUCTION_KEY_IN_PGB} --androidKeyPassword {PASSWORD_OF_ANDROID_PRODUCTION_KEY_IN_PGB}

The following node packages need to be installed for it all to work:

  • phonegap-build-api
@robdmoore
robdmoore / gist:dcd325e0ee73493ff1b7
Created June 18, 2014 14:38
PowerShell to get a publish settings file in a semi-automated way
$scriptpath = $(Split-Path $MyInvocation.MyCommand.Path)
cd $scriptpath
if (-not (ls *.publishsettings | Test-Any)) {
Write-Warning "Please save a .publishsettings file to this folder"
start .
Get-AzurePublishSettingsFile
exit 1
}
@robdmoore
robdmoore / gist:8644975
Created January 27, 2014 08:36
Data-driven tests with NUnit and XUnit when you have a Specification base class
public abstract class Specification
{
[Test]
public virtual void Run()
{
this.BDDfy();
}
[Fact]
public void RunX()