Skip to content

Instantly share code, notes, and snippets.

View KeithP's full-sized avatar

Keith Payne KeithP

  • equidat
  • London
  • 11:53 (UTC +01:00)
View GitHub Profile
@KeithP
KeithP / privacy_notice.html.md
Last active April 8, 2018 22:00
Privacy Noitice - for Simple GDPR Compliance

DATA PRIVACY NOTICE

Thank you for using MyWebApp.com. This notice is to help you understand what information we collect, how we use it and what choices you have about it.

1. How we collect information:

a) When you give it to us or give us permission to obtain it

<!-- START-->
<hr>
<h3>Current planning applications:</h3>
<p><code><var><cite>Larger schemes currently awaiting planning decisions (updated weekly)</cite></var></code></p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json2html/1.2.0/json2html.min.js"></script><script>
function convertDate(inputFormat) {
function pad(s) { return (s < 10) ? '0' + s : s; }
var d = new Date(inputFormat);
return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');
}
@KeithP
KeithP / phone_breadcrumbs_builder.rb
Last active July 19, 2018 10:37
Make use of your Breadcrumbs in your phone-specific views, to give a simple page title and navigation up 1 in the Breadcrumb stack. You have already configured every page with Breadcrumbs, so use them in your phone view header.
# lib/phone_breadcrumbs_builder.rb
# inspired by https://gist.githubusercontent.com/marlosirapuan/3ceb02972400ea98ac5c8f419a61806b/raw/d994dc2d6b35702b4a66e2d1a01a9e9956883375/bulma_breadcrumbs_builder.rb
#
# Make use of your Breadcrumbs in your phone-specific views, to give a simple page title and navigation up 1
# in the Breadcrumb stack. You have already configured every page with Breadcrumbs, so use them in your phone view header.
#
# Example render in your phone view header:
#
# `<a href="/"><i class="fa fa-chevron-left"></i></a> This Page Title`
#
@KeithP
KeithP / Carrd.co: add a Twitter Intent icon using Embed Control in the footer
Last active August 21, 2020 16:17
How to add a twitter card and intent to Carrd.co
@KeithP
KeithP / markdown_template_handler.rb
Created November 6, 2023 10:58
MarkdownTemplateHandler fixed for Rails 7.1
# config/initializers/markdown_template_handler.rb
module MarkdownTemplateHandler
def self.call( template, source=nil )
source ||= template.source
# This worked prior to Rails 7.1:
# compiled_source = erb.call( template, source )
# But with Rails 7.1 it threw "ActionView::Template::Error: wrong argument type ActionView::OutputBuffer (expected String)"