Skip to content

Instantly share code, notes, and snippets.

View mandrasch's full-sized avatar

Matthias Andrasch mandrasch

View GitHub Profile
@mandrasch
mandrasch / README.md
Last active September 25, 2023 10:39
DDEV for existing wordpress site (with DDEV hooks)

UPDATE 2021: Checkout https://github.com/programmieraffe/ddev-pull-wp

This tutorial is for existing wordpress sites, which you want to edit/develop locally with ddev. Use case: Maybe you have a child-theme or plugin stored in git and you want to test it with the actual wordpress website.

  1. Setup blank folder mylocalwpsite/, add .ddev/config.yaml
  2. Adjust Line 19 in config.yaml and change it to the actual live URL of your wp site
  3. Dump your sql-Database (e.g. phpMyAdmin), reimport it with ddev import-db (https://ddev.readthedocs.io/en/latest/users/cli-usage/#importing-a-database)
  4. Download all wordpress files via sftp/ssh in your local folder (or use plugins such as https://wordpress.org/plugins/backwpup/), except your git tracked files (child-theme or plugin e.g.)
  5. ddev start
@mandrasch
mandrasch / Code.gs
Last active June 25, 2020 14:56
Copy YouTube channel video to Drive Spreadsheet (Google Apps Script), spreadsheet template: https://docs.google.com/spreadsheets/d/1LvF0iqeQQyoUc_NjiIYjTvYGtIMWIXFlTHUGhhYXZ5g/edit#gid=0
/**
* Original Source: https://developers.google.com/youtube/v3/code_samples/apps-script
* Custom modifications by Matthias Andrasch, CC0 https://creativecommons.org/publicdomain/zero/1.0/deed.de
* Button solution via: https://www.benlcollins.com/apps-script/google-sheets-button/
*
* Get URL, title, thumbnail from playlist or channel (via YouTube Data API)
* YouTube API data needs to be enabled in "resources" -> "Advanced google services"
*/
function retrieveChannelOrPlaylistVideos() {
#content textarea{
resize: vertical !important;
min-height:100px !important;
}
@mandrasch
mandrasch / images.html
Created November 20, 2019 10:04
oerworldmap Image carousel attribution with imagecodr.org
<html>
<head>
<body>
<div about='https://farm66.static.flickr.com/65535/47788057632_f998372e51_b.jpg'><a href='https://www.flickr.com/photos/ter-burg/47788057632/' target='_blank'>
<img xmlns:dct='http://purl.org/dc/terms/' href='http://purl.org/dc/dcmitype/StillImage' rel='dct:type' src='https://farm66.static.flickr.com/65535/47788057632_f998372e51_b.jpg' alt='Creative Commons Global Summit 2019 by Sebastiaan ter Burg, on Flickr' title='Creative Commons Global Summit 2019 by Sebastiaan ter Burg, on Flickr' border='0'/></a>
<br/>&quot;<a href='https://www.flickr.com/photos/ter-burg/47788057632/' target='_blank'>Creative Commons Global Summit 2019</a>&quot;&nbsp;(<a rel='license' href='https://creativecommons.org/licenses/by/2.0/' target='_blank'>CC BY 2.0</a>)&nbsp;by&nbsp;<a xmlns:cc='http://creativecommons.org/ns#' rel='cc:attributionURL' property='cc:attributionName' href='https://www.flickr.com/people/ter-burg/' target='_blank'>Sebastiaan ter Burg</a>
</div>
<div about='https://
@mandrasch
mandrasch / gist:be3c7ce89924953e38ae32c6f916885a
Last active October 23, 2019 10:22
OER World Map Search Queries for Country + Consultant
https://oerworldmap.org/resource/?filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH&filter.about.additionalType.@id=https%3A%2F%2Foerworldmap.org%2Fassets%2Fjson%2Fpersons.json%23consultant&map=11.62955,49.45440,5
First link is broken, hashtags need to be manually decoded :/
https://oerworldmap.org/resource/?filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH&filter.about.additionalType.@id=https://oerworldmap.org/assets/json/persons.json%23consultant
https://oerworldmap.org/resource/?filter.about.additionalType.@id=https%3A%2F%2Foerworldmap.org%2Fassets%2Fjson%2Fpersons.json%23consultant&filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH
As soon as I scroll in the map, link changes to - after it is shared, it is broken (# on wron
@mandrasch
mandrasch / quickhack.js
Created April 14, 2019 17:28
H5P dialog cards hide image until turnover
/*
1. insert via https://de.wordpress.org/plugins/custom-css-js/ plugin
2. change post-id number (can be found in source code of wordpress)
3. maybe change iframe id
4. enjoy! ;-)
See: https://h5p.org/node/70099
*/
jQuery(document).ready(function($) {
/*console.log('custom js loaded - 17');*/
/* inject css to first iframe, change postid for page */
@mandrasch
mandrasch / index.html
Created August 12, 2017 12:09
h5p-standalone, edited demo/index.html
<html>
<head>
<link type="text/css" rel="stylesheet" media="all" href="dist/styles/h5p.css" />
<meta charset="utf-8" />
<title>H5P Webview test</title>
<script type="text/javascript" src="dist/js/h5p-standalone-main.js"></script>
<script type="text/javascript">
(function($) {
$(function() {
/* Feld "Interaction title" überschreiben (Getestet mit Google Chrome Webdeveloper Console */
var iFrameDOM = window.jQuery("iframe.h5p-editor-iframe").contents();
iFrameDOM.find("div.field-name-interaction > input").val('ÜBERSETZUNG');
/* Bookmarklet kann hier generiert werden: http://mrcoles.com/bookmarklet/ */
@mandrasch
mandrasch / fritz.m3u
Last active April 24, 2017 15:09
Detektor FM & RaspberryPI
#EXTM3U
#EXTINF:-1,Fritz vom rbb live hören - www.fritz.de
http://rbb-mp3-fritz-m.akacast.akamaistream.net/7/799/292093/v1/gnl.akacast.akamaistream.net/rbb_mp3_fritz_m
@mandrasch
mandrasch / course with telephone number.json
Last active September 14, 2016 08:15
course.json example
{
"title": "Mein flexibler Online-Kurs",
"id":1,
"authors":[{
"name":"Doerte",
"surname":"Digital",
"contact":
{
"telephone-office":"+4927192723829289",
"student-hotline-mobile":"+4929380121293812983012",