Skip to content

Instantly share code, notes, and snippets.

View phdd's full-sized avatar

Peter phdd

View GitHub Profile
@phdd
phdd / app.sql
Created August 8, 2014 07:33
Comprot application DDL
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `comprot_entity_ref` (
`id` varchar(255) COLLATE latin1_german2_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
CREATE TABLE IF NOT EXISTS `comprot_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`displayName` varchar(255) COLLATE latin1_german2_ci NOT NULL,
@phdd
phdd / boot
Last active October 1, 2019 06:57
Handle Spring Boot maven modules like daemons
#!/bin/bash
################################################################################
#
# Handle Spring Boot maven modules like daemons
# Relies on ApplicationPidFileWriter:
#
# @SpringBootApplication public class GodApp {
#
# // [...]
#
@phdd
phdd / trello-card-enhancer.js
Last active January 2, 2018 23:43
Enhance Trello-cards with markdown based description with this Greasemonkey script.
// ==UserScript==
// @name Trello Card Enhancer
// @namespace https://gist.github.com/phdd/f3e8cf831c1c0b6fe324
// @description Enhance cards with markdown based description
// @copyright 2015+, Peter Heisig
// @version 1.3
// @updateURL https://gist.githubusercontent.com/raw/f3e8cf831c1c0b6fe324/trello-card-enhancer.js
//
// @match https://trello.com/*
// @match https://*.trello.com/*
public class OAuth2ServiceRequestInterceptor implements RequestInterceptor {
OAuth2AccessToken token;
OAuth2RestTemplate serviceTemplate;
public void setServiceTemplate(OAuth2RestTemplate serviceTemplate) {
this.serviceTemplate = serviceTemplate;
}
@Override public void apply(RequestTemplate template) {
@phdd
phdd / keybase.md
Last active January 18, 2019 09:41

Keybase proof

I hereby claim:

  • I am phdd on github.
  • I am phdd (https://keybase.io/phdd) on keybase.
  • I have a public key ASCZSc5bClUqt31sel_w105DlKivTmKUZw7nULW8NHZp2go

To claim this, I am signing this object:

@phdd
phdd / example.md
Created June 8, 2017 12:51
Pandoc - Conditional Visibility based on Output Format
This may be shown in Latex, PDF and HTML
This may be shown in presentation
@phdd
phdd / watch.sh
Created June 9, 2017 13:57
Pandoc watch script
#!/bin/bash
FORMAT=$1
DOCUMENT=$2
livereload "$DOCUMENT.html" -d -w 200 &
LIVERELOAD=$!
http-server . &
HTTP_SERVER=$!
@phdd
phdd / pandoc-filter-include.py
Created June 9, 2017 13:57
Pandoc include filter
#!/usr/bin/env python
"""
Include contents from other files, even recursively.
Examples:
- Include first chaper from markdown file
[](chapter1.md){.include .markdown}
@phdd
phdd / dropbox-owncloud-sync.js
Last active June 25, 2017 10:18
FaaS triggering OwnCloud reload on Dropbox change
'use latest';
import rp from 'request-promise';
import express from 'express';
import bodyParser from 'body-parser';
import { fromExpress } from 'webtask-tools';
const app = express();
app.use(bodyParser.json());
@phdd
phdd / revealjs.css
Created January 29, 2018 09:11
Reveal.js Custom Style
.reveal section img {
border: none;
}