Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Engelmayer christophengelmayer

View GitHub Profile
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active Apr 13, 2021
Tailwind CSS responsive Video embed
View tailwind-resonsive-embed.html
<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 Jan 21, 2020
Neos CMS + webpack-dev-server
View Settings.yaml
# Configuration/Development/Webpack/Settings.yaml
Neos:
Flow:
http:
baseUri: 'http://localhost:3000/'
View AbstractPage.fusion
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 Jun 19, 2017
NEOS CMS FormFinisher - Email with attachments
View CustomFormFinisher.php
<?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 Jan 7, 2017
Makefile Laravel deployment
View Makefile
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/*' \
View language-switch.php
<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 Jan 2, 2017
Makefile Rsync ProcessWire
View Makefile
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 Nov 22, 2016
Vagrant Scotchbox customized
View Vagrantfile
# -*- 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"]
View SpriteEmbed.js
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]);
}