Skip to content

Instantly share code, notes, and snippets.

View christophengelmayer's full-sized avatar

Christoph Engelmayer christophengelmayer

View GitHub Profile
@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>'}
@[email protected] = ${q(node).children().count() > 0}
collection = ${q(node).children().get()}
itemName = 'node'
itemRenderer = Flowpack.FusionBP:RecursiveMenu
}
@veuncent
veuncent / create_wagtail_pages_through_migration
Last active June 26, 2024 03:14
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')
@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
@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
# Clone the repo
git clone https://github.com/imartinez/privateGPT
cd privateGPT
# Install Python 3.11
pyenv install 3.11
pyenv local 3.11
# Install dependencies
poetry install --with ui,local