Skip to content

Instantly share code, notes, and snippets.

View christophengelmayer's full-sized avatar

Christoph Engelmayer christophengelmayer

View GitHub Profile
@stefansl
stefansl / contao_og
Last active October 13, 2015 07:38
Contao - opengraph tags in page layout
<meta property="og:image" content="{{env::url}}/files/_theme/images/facebook_preview.png" />
<meta property="og:url" content="{{env::path}}{{env::request}}" />
<meta property="og:site_name" content="{{page::rootTitle}}" />
<meta property="og:title" content="{{page::pageTitle}}" />
<meta property="og:type" content="website" />
@soulcyon
soulcyon / lazyloadwebfonts.js
Last active October 25, 2015 13:58
Google Webfonts - Lazy Loader
WebFontConfig = {
/* Add your desired font family here, its a simple Javascript array */
google: { families: [ 'Ubuntu' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
@tomraithel
tomraithel / .htaccess 2
Created February 25, 2013 21:51
LARAVEL: .htaccess configuration on domain-factory
# Apache configuration file
# http://httpd.apache.org/docs/2.2/mod/quickreference.html
# Note: ".htaccess" files are an overhead for each request. This logic should
# be placed in your Apache config whenever possible.
# http://httpd.apache.org/docs/2.2/howto/htaccess.html
# Turning on the rewrite engine is necessary for the following rules and
# features. "+FollowSymLinks" must be enabled for this to work symbolically.
@dimaip
dimaip / Recursion.fusion
Last active January 18, 2018 10:30
Recursive rendering of menus with Fusion
prototype(Flowpack.FusionBP:RecursiveMenu) < prototype(Neos.Fusion:Array) {
@process.tmpl = ${'<li>' + value + '</li>'}
title = ${node.properties.title || '<em>' + node.name + '</em>'}
nextLevel = Neos.Fusion:Collection {
@process.tmpl = ${'<ul>' + value + '</ul>'}
@process.tmpl.@if.notEmpty = ${q(node).children().count() > 0}
collection = ${q(node).children().get()}
itemName = 'node'
itemRenderer = Flowpack.FusionBP:RecursiveMenu
}
@somatonic
somatonic / from.php
Last active June 26, 2018 19:23
Create a page edit form on frontend using PW API and fields from the template of the page
<?php
// get a page
$editpage = $pages->get("/editme/");
$ignorefields = array("isOld","language_published");
$form = $modules->get("InputfieldForm");
$form->method = 'post';
$form->action = './';
@bwaidelich
bwaidelich / Component_Atom_DefaultElement.fusion
Last active July 17, 2019 13:09
Atomic Fusion based Form Definition
prototype(My.Package:Form.DefaultElement) < prototype(Neos.Fusion:Component) {
# API
id = ''
name = ''
label = ''
value = null
isRequired = false
properties = Neos.Fusion:RawArray
validationErrors = Neos.Fusion:RawArray
@veuncent
veuncent / create_wagtail_pages_through_migration
Last active August 26, 2021 07:39
Set wagtail (home)pages programmatically during Django Migrations
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from wagtail.wagtailcore.models import Page, Site
def forwards_func(apps, schema_editor):
HomePage = apps.get_model('website', 'HomePage')
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@T1T4N
T1T4N / run_whisper.sh
Created October 10, 2022 14:47
Run OpenAI Whisper on M1 MacBook Pro
# Original author: https://twitter.com/esizkur/status/1579207536812904448
git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
make
./download-ggml-model.sh large
ffmpeg -i recording.m4a -acodec pcm_s16le -ar 16000 recording.wav
./main -m models/ggml-large.bin -l de -f recording.wav | tee transcript.log
@somatonic
somatonic / inputfieldfile-form.php
Last active March 31, 2023 01:14
ProcessWire front-end upload form example using ProcessWire Inputfields and form processing.
<?php
/**
* ProcessWire (2.5) InputfieldFile front-end upload form example
* Various workarounds to get it working with Errors for WireUpload
* and removing files upload after error
*/
$sent = false;
$upload_path = $config->uploadTmpDir;