Skip to content

Instantly share code, notes, and snippets.

@johannes-weber
johannes-weber / ssl-serverpilot.md
Created July 25, 2018 20:36 — forked from arjenblokzijl/ssl-serverpilot.md
How To Add SSL to ServerPilot nginx

How To Add SSL to ServerPilot nginx

Requirements

  1. Domain (i.e. example.com)
  2. Subdomain(s): (i.e. www.example.com)
  3. Username
  4. App name

Create the Certificate

@johannes-weber
johannes-weber / heap.js
Created January 17, 2018 15:25
JavaScript implementation of a Min and Max Heap
function Heap (compareFunc) {
var _self = this;
this.elements = [];
this.compareFunc = compareFunc;
_self.swap = function(aIdx, bIdx) {
var a = _self.elements[aIdx];
var b = _self.elements[bIdx];
var tmp = a;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@johannes-weber
johannes-weber / base-directive.ts
Created November 20, 2015 13:24
Using Angular 1.x Directives with TypeScript
export default class BaseDirective {
restrict: any;
scope: any;
template: any;
transclude: any;
require: any;
compile: any;
controller: any;
bindToController: any;
controllerAs: any;
@johannes-weber
johannes-weber / ValidateFloat.js
Last active January 24, 2016 10:35
AngularJS Custom Float Validation
'use strict';
/**
* This directive parses both 1.2 and 1,2 into a valid float number 1.2.
* Note that you can't use input type number here as HTML5 browsers would
* not allow the user to type what it would consider an invalid number such as 1,2.
*
* <input ng-model="{yourModel}" validate-float />
*/
angular.module('Library').directive('validateFloat', function () {