Skip to content

Instantly share code, notes, and snippets.

View klinkby's full-sized avatar

Mads Breusch Klinkby klinkby

View GitHub Profile
#!/bin/bash
sudo docker pull nginx:alpine
sudo docker pull jwilder/docker-gen
sudo docker pull jrcs/letsencrypt-nginx-proxy-companion
sudo docker pull zzrot/alpine-ghost
wget https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl
sudo cp nginx.tmpl /volumes/proxy/templates/
@klinkby
klinkby / getGroupedViewData.js
Created September 8, 2016 14:16
Extracts aggregated values from a SharePoint view using grouping
function Grouping(title, value, count) {
Object.defineProperties(this, {
title: { value: title },
value: { value: value },
count: { value: count },
groups: { writable: true }
});
}
function getGroupedViewData(listTitle, viewTitle, success, fail) {
@klinkby
klinkby / ManagedWebBrowser.cs
Last active March 14, 2021 13:45
Wraps IE to support lifetime
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Threading;
using SHDocVw;
namespace Capto
{
/// <summary>
#
# This is a VCL file for Varnish used with @TryGhost blog.
# It rewrites Wordpress-style /yyyy/mm/dd/slug urls
# to /slug and /rss20.xml to Ghost's /rss/
# Adds 60 mins cachability to pages, adds AMP Project CSP header and a few other
# security headers giving the site an A+ on https://securityheaders.io/
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
@klinkby
klinkby / gist:22b417e0f1f80096a3c1
Created March 11, 2016 08:22
Query SharePoint Announcemements in this site collection that are not expired
(ContentTypeId:0x0104*) (contentclass:STS_ListItem) (Path:{SiteCollection.URL}) NOT (ExpirationTime<{Today})
OOB on O365
@klinkby
klinkby / List-View-Folder.js
Created February 23, 2016 11:24
Client side browser to specific folder in data view web part
(function () {
"use strict";
/////
// Deserialize and serialize a query string
function QueryString(qs) {
var re = /([^&=]+)=([^&]*)/g,
m;
while (m = re.exec((qs || location.search).substring(1))) { // skip the question mark
this[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
@klinkby
klinkby / querystring.js
Created February 23, 2016 10:10
Deserialize and serialize a query string
function QueryString(qs) {
var re = /([^&=]+)=([^&]*)/g,
m;
while (m = re.exec((qs || location.search).substring(1))) { // skip the question mark
this[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}
}
QueryString.prototype.toString = function () {
var ser = "?";
### Keybase proof
I hereby claim:
* I am klinkby on github.
* I am klinkby (https://keybase.io/klinkby) on keybase.
* I have a public key whose fingerprint is F9D7 19F6 A0A0 0278 FFB3 3AF0 BC98 741A 9997 9D59
To claim this, I am signing this object: