Skip to content

Instantly share code, notes, and snippets.

View christophengelmayer's full-sized avatar

Christoph Engelmayer christophengelmayer

View GitHub Profile
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active September 10, 2024 11:52
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@christophengelmayer
christophengelmayer / Settings.yaml
Last active January 21, 2020 21:35
Neos CMS + webpack-dev-server
# Configuration/Development/Webpack/Settings.yaml
Neos:
Flow:
http:
baseUri: 'http://localhost:3000/'
prototype(Your.Site:AbstractPage) < prototype(Page) {
head {
headTags = ${'
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
'}
stylesheets {
css = Neos.Fusion:Tag {
tagName = 'link'
attributes {
@christophengelmayer
christophengelmayer / CustomFormFinisher.php
Created June 19, 2017 15:15
NEOS CMS FormFinisher - Email with attachments
<?php
// Classes/Finishers/CustomFormFinisher.php
namespace UnWomen\Website\Finishers;
use Neos\Flow\Annotations as Flow;
use Neos\Form\Core\Model\AbstractFinisher;
use Neos\Form\Exception\FinisherException;
use Neos\FluidAdaptor\View\StandaloneView;
use Neos\SwiftMailer;
@christophengelmayer
christophengelmayer / Makefile
Created January 7, 2017 19:36
Makefile Laravel deployment
rsync:
rsync -avzu --delete --progress -h \
--exclude 'Makefile' \
--exclude '.git' \
--exclude '/.env' \
--exclude '/public/.htaccess' \
--exclude '/database/database.sqlite' \
--exclude '/public/storage' \
--exclude '/bootstrap/cache' \
--exclude 'storage/framework/*' \
@christophengelmayer
christophengelmayer / language-switch.php
Created January 5, 2017 13:12
ProcessWire Language Switch
<ul class="navigation__language">
<?php
foreach($languages as $language) {
if(!$page->viewable($language)) continue;
$class = "$language" == "$user->language" ? "navigation__current" : "";
$url = $page->localUrl($language);
echo "<li class='$class'><a title='$language->title' href='$url'>$language->title</a></li>";
}
?>
</ul>
@christophengelmayer
christophengelmayer / Makefile
Last active January 2, 2017 16:40
Makefile Rsync ProcessWire
rsync:
rsync -avzuhO --delete \
--exclude '.git*' \
--exclude '.DS_Store' \
--exclude 'Makefile' \
--exclude '/src' \
--exclude '/node_modules' \
--exclude '/site/config.php' \
--exclude '/site/assets/sessions' \
--exclude '/site/assets/files' \
@christophengelmayer
christophengelmayer / Vagrantfile
Created November 22, 2016 15:52
Vagrant Scotchbox customized
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www/public", :mount_options => ["dmode=777", "fmode=666"]
@christophengelmayer
christophengelmayer / SpriteEmbed.js
Last active November 9, 2016 13:56
SVG Sprites Workflow
export default class SvgSpriteEmbed {
constructor(url) {
var ajax = new XMLHttpRequest();
ajax.open("GET", url, true);
ajax.responseType = "document";
ajax.onload = function(e) {
var element = ajax.responseXML.documentElement;
element.setAttribute("class", "u-hidden-visually");
document.body.insertBefore(element, document.body.childNodes[0]);
}