Skip to content

Instantly share code, notes, and snippets.

View tjmoore's full-sized avatar

Tim Moore tjmoore

View GitHub Profile
@tjmoore
tjmoore / version_compare.js
Last active August 29, 2015 14:19 — forked from TheDistantSea/version_compare.js
jslinted version of version_compare.js
/**
* From: https://gist.github.com/TheDistantSea/8021359
*
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
@tjmoore
tjmoore / service_account_with_json_key.cs
Created August 11, 2015 12:11
Simple code snippet showing use of Google Service Account JSON key file within ServiceAccountCredential
// Simple code snippet showing use of Google Service Account JSON key file within ServiceAccountCredential.
using System.IO;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Calendar.v3;
using Google.Apis.Calendar.v3.Data;
using Google.Apis.Services;
using Newtonsoft.Json.Linq;
var serviceAccountJson = File.ReadAllText("<JSON-FILE-HERE>");