Skip to content

Instantly share code, notes, and snippets.

View allupaku's full-sized avatar

Alt Ctrl Del allupaku

  • Diamond Light Source
  • United Kingdom
View GitHub Profile

Parse the kubernetes manifest in yaml or json, don't care a manifest type.

Examples:

package main

import (
	"bytes"
	"context"
@allupaku
allupaku / .htaccess
Created January 20, 2017 07:01 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@allupaku
allupaku / controller.snippet.js
Created February 15, 2016 08:31 — forked from njcaruso/controller.snippet.js
Custom loopback change-stream to only show stream updates from the logged in user. The intent is to have a `Message` model that contains private messages for users. The current implementation of change-stream while it accepts an options.where clause, it does not use it. See https://github.com/strongloop/angular-live-set/issues/11.
var url = '/api/messages/stream-updates' +
'?access_token=' + LoopBackAuth.accessTokenId;
var src = new EventSource(url);
var changes = createChangeStream(src);
var set;
Message.find({
filter: {
where: {