Skip to content

Instantly share code, notes, and snippets.

wottpal / date-formats.ts
Created Apr 18, 2019
Custom DateFormats & DateAdapter for Angular Material MatDatepicker using Day.js
View date-formats.ts
import { Platform } from '@angular/cdk/platform';
import { NativeDateAdapter } from '@angular/material';
import * as dayjs from 'dayjs';
import 'dayjs/locale/de';
import * as customParseFormat from 'dayjs/plugin/customParseFormat';
import * as localizedFormat from 'dayjs/plugin/localizedFormat';
* Custom Date-Formats and Adapter (using
wottpal / counter.component.ts
Last active Mar 25, 2020
Simple Angular Counter/Countdown Component with dayjs & rxjs
View counter.component.ts
* Example Usage:
* # Counter
* const now = dayjs()
* <app-counter [autostart]="true" [mode]="forwards" [startTime]="now"></app-counter>
* # Countdown
* const later = dayjs().add(1, 'minute')
wottpal / form.service.ts
Last active Dec 13, 2018
Angular Service to synchronize FormGroup(s) with LocalStorage (get & set)
View form.service.ts
import { Injectable } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import * as dayjs from 'dayjs'
providedIn: 'root'
export class FormService {
#! -*- coding: utf-8 -*-
import sys
import time
import numpy as np
import gensim
import matplotlib.pyplot as plt
from matplotlib import font_manager, rc
from sklearn.manifold import TSNE
from sklearn.cluster import MiniBatchKMeans
def VGG_16_BN(input_shape):
model = models.Sequential()
model.add(Convolution2D(64, (3,3), input_shape=input_shape, activation='relu', padding='same', use_bias=False))
model.add(Convolution2D(64, (3,3), activation='relu', padding='same', use_bias=False))
model.add(MaxPooling2D((2,2), strides=(2,2)))
model.add(Convolution2D(128, (3,3), activation='relu', padding='same', use_bias=False))

Simple Contact-Form in Kirby 3

As a starting point I've used the latest Starterkit (Beta 4) combined with the core from the latest Nightly Build (18-08-06).

First, set email-properties in your config. I would recommend using a mail-service like Mailgun (via SMTP) because setting everything up on your own server is cumbersome, error-prone, and unsecure. But of course, it's up to you.


View kirby-nginx
# block content
location ~ ^/content/(.*).(txt|md|mdown)$
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
wottpal / debug.js
Last active Apr 19, 2018
A convenience wrapper around the Console API which adds several functionalities.
View debug.js
* A convenience wrapper around the Console API which adds:
* - Logging has to be globally enabled first (in a dev-environment)
* - Even when disabled logged messages are cached and can be displayed later
* - Prefix messages with a custom〈 Label 〉
* TODO Maybe add verbose-flag to really be able to log everything if needed
wottpal / exp-027.js
Last active Feb 10, 2018
* numberOfPoints defines amount of points * respects frameWidth * returns array of triangles in the format [ [[x1, y1],[x2, y2],[x3, y3]], ... ]
View exp-027.js
function triangulateCanvas() {
let points = [], triangles = []
for (let i = 0; i < numberOfPoints; i++) {
const randomX = random(frameWidth, WIDTH-frameWidth)
const randomY = random(frameWidth, HEIGHT-frameWidth)
constrain(randomX, frameWidth, WIDTH-frameWidth),
constrain(randomY, frameWidth, HEIGHT-frameWidth)
wottpal / relative-time.php
Last active Oct 21, 2017 — forked from mtttmpl/relative-time.php
Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks'). With the argument $max_diff you can specify the number of days from when the actual date should be returned.
View relative-time.php
* Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks').
* With the argument `$max_diff` you can specify the number of days from when the
* actual date should be returned witht the format of `$date_format`.
* Gist:
* Fork of: