Skip to content

Instantly share code, notes, and snippets.

View lukas-h's full-sized avatar
🎯
Focusing

Lukas Himsel lukas-h

🎯
Focusing
  • Nuremberg, Germany
  • 01:13 (UTC +02:00)
View GitHub Profile
@lukas-h
lukas-h / formatRfc822.dart
Last active April 23, 2024 05:47
Dart DateTime DateFormat to RFC-822 String
import 'package:intl/intl.dart';
import 'package:test/test.dart';
formatRfc822(DateTime d) {
var template = "EEE, dd MMM yyyy HH:mm:ss";
var out = DateFormat(template).format(d);
if (d.isUtc) {
out += ' GMT';
} else {
var offset = d.toLocal().timeZoneOffset.inHours * 100;
@lukas-h
lukas-h / le-nombre-d-or.html
Last active April 24, 2020 22:35
Golden Ratio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Le nombre d'or</title>
</head>
<body class="gr-column">
@lukas-h
lukas-h / strptime.dart
Last active May 4, 2020 22:19
Ruby's date formatting method strptime(date, format) in Dart
import 'package:intl/intl.dart';
Map conversions = {
'a': (d) => 'E',
'A': (d) => 'EEEE',
'b': (d) => 'MMM',
'B': (d) => 'MMMM',
'+': (d) => _strptime(d, '%a %b %e %H:%M:%S %Z %Y'),
'%': (d) => '%%',
'Z': (d) => 'vvvv',
@lukas-h
lukas-h / amp-dsgvo-opt-in.md
Last active May 29, 2020 08:24
DSGVO-Banner Opt-in für AMP-Webseiten

DSGVO-Cookie-Banner mit Opt-in für AMP

Nach der neuen DSGVO-Regelung müssen Websites, die Cookies verwenden einen explizites Opt-In machen.

Siehe hier: DSGVO-Entscheidung vom Bundesgerichtshof: Wer braucht jetzt einen Cookie-Banner?

Dies sollte als "Starthilfe" und nicht als vollständige Implementierung angesehen werden.

1. Schritt

Zu den amp-analytics-Tags muss der Parameter data-block-on-consent="_till_accepted" hinzugefügt werden.

@lukas-h
lukas-h / index.html
Created June 17, 2020 14:49
AMP Iframe
<!DOCTYPE html>
<html amphtml>
<head>
...
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
</head>
<body>
...
<amp-iframe
@lukas-h
lukas-h / jekyll-jamstack.md
Last active July 26, 2020 12:46
Jekyll & JAMStack Ressources
@lukas-h
lukas-h / pub-dev-copy.html
Last active August 2, 2020 22:39
pub.dev dependency copy shortcut
<div class="" style="
padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: 1px solid #c8c8ca;
">
<h3 class="title">Install latest version:</h3>
<div style="
display: flex;
align-content: center;
">
@lukas-h
lukas-h / get.sh
Created August 11, 2020 09:27
Scrape website recursively
wget \
--recursive \
--no-clobber \
--page-requisites \
--convert-links \
--restrict-file-names=windows \
--domains $1 \
--no-parent \
https://$1/
@lukas-h
lukas-h / static-site-hosting.md
Last active January 30, 2021 12:51
Static Site Showdown
Name Build Minutes Concurrent Builds Outbound Transfer Source Provider Number of Sites Next pricing step/Month Website
CloudFlare Pages 500 1 Unlimited Github Unlimited 20$, 5 concurrent builds, 5K Build minutes https://pages.cloudflare.com
Vercel
Github Pages
Gitlab
Bitbucket
Digitalocean
Netlify
Render