Skip to content

Instantly share code, notes, and snippets.

View robdmoore's full-sized avatar

Rob Moore (MakerX) robdmoore

View GitHub Profile
@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 / README.md
Last active February 21, 2023 11:04
Example output stability diff for Beaker 0.x -> 1.0
@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 / setup.sql
Last active September 23, 2022 15:18
Automated install of SQL Express from commandline
# If you want to give owner access to the whole server to a particular user account this is how
exec sp_addrolemember 'db_owner', 'NT AUTHORITY\NETWORK SERVICE';
GO
# If you want to idempotently ensure a particular database with name DatabaseName exists this is how
IF NOT db_id('DatabaseName') IS NOT NULL BEGIN
PRINT 'Creating database...'
CREATE DATABASE [DatabaseName]
PRINT 'Created database.'
@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 / init.ps1
Last active November 2, 2020 11:22
Prototyping NuGet install.ps1 script to install chrome driver as embedded .exe to project
param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath "webdriver_installs.psm1")
@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 / _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 / _readme.md
Last active March 31, 2018 09:27
Wordpress -> Jekyll converter

Following https://mdavies.net/2014/11/27/migrating-wpjekyll/#migrate-from-wordpress you can convert your posts across to Jekyll format, but it adds superfluous metadata and also doesn't correctly handle Wordpress shorttags. This program helps with that.

Fair warning: it's deliberately dirty / hacky code. I ran it with the posts in a Git repo and inspected file-by-file tweaking as I went.