Skip to content

Instantly share code, notes, and snippets.

View ckimrie's full-sized avatar

Christopher Imrie ckimrie

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ckimrie on github.
  • I am ckimrie ( on keybase.
  • I have a public key ASB-F0l2fSFbaeWHkKPvzAEOVqhV52uSOPoINpy2YikFKwo

To claim this, I am signing this object:

ckimrie / vpc-public-private-eu-west-1.template
Created April 12, 2018 12:04
AWS Cloudformation template to create a VPC with three public/private subnet pairs with default internet gateway routes configured.
View vpc-public-private-eu-west-1.template
This template deploys a VPC, with a three public and private subnets spread
across three Availability Zones. It deploys an Internet Gateway, with a default
route on the public subnets. It deploys a pair of NAT Gateways (one in each AZ),
and default routes for them in the private subnets.
ckimrie / UserProfile.ts
Created July 17, 2017 16:23
Reference user profile entity and objects.
View UserProfile.ts
interface User {
//Identification & Classification
userId: number;
userName: string; //Unique key for application
application: Application; //eg User is a member of the Chiltern Arriva system ('application' provides flexibility
// for Chiltern to have many apps with Ace system)
firstName: string;
ckimrie / example.component.ts
Last active November 9, 2023 10:00
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
View example.component.ts
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
export class ExampleComponent implements OnInit, OnDestroy {
View Login with aws cognito and federated identities.js
//On page load
// - Browser -
region: "eu-west-1"
var credConfig = {
ckimrie / signApiGatewayAngular2HttpRequest.ts
Last active January 6, 2019 11:33
How to use AWS Cognito to sign an http request to a custom AWS Api Gateway using IAMs Authorization.
View signApiGatewayAngular2HttpRequest.ts
//---- Angular 2 Http Service Example ----
import {Injectable} from "@angular/core";
import {Http, Headers} from "@angular/http";
const AWS = require("aws-sdk");
export class ApiGatewayService {
constructor(private http:Http){
View component2.html
<link rel="import" href="">
<link rel="import" href="">
<dom-module id="component-2">
<style include="component-1">
:host {
display: block;
View component.html
<link rel="import" href="">
<dom-module id="component-1">
:host {
display: block;
.red-box {
background-color: red;
color: white;
View jquery.unserialize.js
* $.unserialize
* Takes a string in format "param1=value1&param2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array.
* Example:
* Input: param1=value1&param2=value2
* Return: { param1 : value1, param2: value2 }
ckimrie / jsbin.oyecax.html
Created August 23, 2013 16:23
JS Bin math visualisation competition entry. Working version can be seen here:
View jsbin.oyecax.html
<!DOCTYPE html>
<meta name="description" content="JS Bin Competition Entry" />
<script src=""></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<div id="surface"></div>