Skip to content

Instantly share code, notes, and snippets.

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

Lukas Himsel lukas-h

🎯
Focusing
  • Nuremberg, Germany
  • 14:49 (UTC +02:00)
View GitHub Profile
@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 / jekyll-jamstack.md
Last active July 26, 2020 12:46
Jekyll & JAMStack Ressources
@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 / 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 / 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 / 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 / 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 / csv_to_map.dart
Last active February 17, 2021 20:55
CSV to List<Map<String, String>> instead of the normal List<List<String>> scheme of the original csv package
class CsvToMapConverter {
CsvToListConverter converter;
CsvToMapConverter(
{String fieldDelimiter = defaultFieldDelimiter,
String textDelimiter = defaultTextDelimiter,
String textEndDelimiter,
String eol = defaultEol,
CsvSettingsDetector csvSettingsDetector,
bool shouldParseNumbers,
bool allowInvalid}) {
@lukas-h
lukas-h / firebase.json
Created December 5, 2019 01:57
my firebase hosting config file
{
"hosting": {
"public": "_site",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [{
"source": "**",
@lukas-h
lukas-h / getip.c
Last active July 13, 2020 08:49
Resolve IP as hostname (unix console tool)
/*
* `getip.c'
*
* Copyright (C) 2015, 2016 Lukas Himsel <lukas.himsel@web.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,