Skip to content

Instantly share code, notes, and snippets.

View kdambekalns's full-sized avatar

Karsten Dambekalns kdambekalns

View GitHub Profile
@RobertAKARobin
RobertAKARobin / safari.md
Last active January 5, 2024 05:41
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@bwaidelich
bwaidelich / GraphQlMiddleware.php
Created January 18, 2021 09:01
Minimal GraphQL example for Flow for interface types
<?php
declare(strict_types=1);
namespace Some\App;
use GraphQL\Error\DebugFlag;
use GraphQL\GraphQL;
use GraphQL\Utils\BuildSchema;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@lorenzulrich
lorenzulrich / SetPropertyUsingEel.php
Created November 18, 2020 18:29
Custom SetPropertyUsingEel transformation for Neos CMS Node Migrations
<?php
namespace My\FoobarCom\Migration\Transformations;
use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Domain\Factory\NodeFactory;
use Neos\ContentRepository\Domain\Service\ContextFactory;
use Neos\ContentRepository\Domain\Model\NodeData;
use Neos\ContentRepository\Migration\Transformations\AbstractTransformation;
use Neos\Eel\EelEvaluatorInterface;
@mficzel
mficzel / WrapperComponent.fusion
Last active June 2, 2024 15:13
Wrapper components
prototype(Vendor.Site:Example) < prototype(Neos.Fusion:Component) {
foo = null
bar = null
renderer = Neos.Fusion:Component {
# pass all outer props to the renderer
@apply.props = ${props}
# alternatively pass explicit props to the renderer
foo = ${props.foo}
@Sebobo
Sebobo / FileSystemSymlinkTarget.php
Last active May 15, 2019 07:49
Use asset title as filename in Neos CMS
<?php
namespace My\Package\ResourceManagement\Target;
use Neos\Flow\Annotations as Flow;
use Cocur\Slugify\Slugify;
use Neos\Flow\ResourceManagement\ResourceMetaDataInterface;
use Neos\Media\Domain\Repository\AssetRepository;
/**
* A target which publishes resources by creating symlinks with the filename based on the files title.
@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@masbicudo
masbicudo / git-find-big-files-in-hist.sh
Created March 23, 2019 00:43
Script to find large files in git history
#!/bin/bash
# This code is based on the awesome answer by @torek from StackOverflow:
# https://stackoverflow.com/a/41626019/195417
# I have only made a shell for his code, added some options, added some colors
# and voilà!
#
# This script can be used to find large files inside a git repository
# and it's whole history. It will list files larger than a given threshold,
# and display these files in a colored human readable way.
#
bl_info = {
"name": "FreeCAD Importer",
"category": "Import-Export",
"author": "Yorik van Havre",
"version": (5, 0, 0),
"blender": (2, 80, 0),
"location": "File > Import > FreeCAD",
"description": "Imports a .FCStd file from FreeCAD",
"warning": "This addon needs FreeCAD installed on your system. Only Part- and Mesh-based objects supported at the moment.",
}
@cweinberger
cweinberger / mysql-drop-all-tables.sh
Created June 6, 2018 12:44
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
<?php
#if (${Namespace})
namespace ${Namespace};
#end
#parse("PHP File Header")
#set($setter = "set" + $FieldName.substring(0,1).toUpperCase() + $FieldName.substring(1))
class ${NAME} implements \JsonSerializable