Skip to content

Instantly share code, notes, and snippets.

View martinburger's full-sized avatar

Martin Burger martinburger

View GitHub Profile
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import svelte from 'rollup-plugin-svelte';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import config from 'sapper/config/rollup.js';
import pkg from './package.json';
import json from '@rollup/plugin-json';
<h2>reCAPTCHA without form / AJAX only</h2>
<div class="panel panel-warning" id="panel-recaptcha">
<div class="panel-heading">
<h3 class="panel-title">Captcha</h3>
</div>
<div class="panel-body">
<div id="recaptcha-service" class="g-recaptcha"
data-callback="recaptchaCallback"
data-sitekey=""></div>
@martinburger
martinburger / ActionBuilderAuthentication.scala
Created February 10, 2014 13:34
How to wrap Actions (in any order) when using Play's ActionBuilder?
package controllers
import play.api._
import play.api.mvc._
import scala.concurrent.Future
/**
* Provide security features via `ActionBuilder`
*/
package models
import play.api.libs.functional.syntax._
import play.api.libs.json._
import play.api.libs.json.util._
import play.api.libs.json.Reads._
import play.api.data.validation.ValidationError
case class User(meta: Option[String], name: String, email: String)
@martinburger
martinburger / fix-calendars.py
Created September 24, 2013 13:54
Fixes DAViCal "event-only" calendars for iOS 7 by inserting now required property 'urn:ietf:params:xml:ns:caldav:supported-calendar-component-set' with value '<comp name="VEVENT" xmlns="urn:ietf:params:xml:ns:caldav"/>'.
#!/usr/bin/env python
import sys
import psycopg2
# http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
CONNECTION_STRING = None
PROPERTY_NAME = 'urn:ietf:params:xml:ns:caldav:supported-calendar-component-set'
PROPERTY_VALUE = '<comp name="VEVENT" xmlns="urn:ietf:params:xml:ns:caldav"/>'