Skip to content

Instantly share code, notes, and snippets.

View ziodave's full-sized avatar

David Riccitelli ziodave

View GitHub Profile
@ziodave
ziodave / 1.patch
Last active March 14, 2024 13:51
bitnami-docker-wordpress-nginx / Dockerfile patch to add php-redis
diff --git a/6/debian-12/Dockerfile b/6/debian-12/Dockerfile
index 7bce99f..64678a4 100644
--- a/6/debian-12/Dockerfile
+++ b/6/debian-12/Dockerfile
@@ -32,6 +32,34 @@ ENV APP_VERSION="6.0.0" \
NGINX_HTTP_PORT_NUMBER="" \
PATH="/opt/bitnami/common/bin:/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/wp-cli/bin:/opt/bitnami/nginx/sbin:/opt/bitnami/mysql/bin:$PATH"
+ARG REDIS_VERSION=5.3.7
+RUN set -ex ; \
<?php
function set_rows( $selector, $value = array(), $post_id = false ) {
// filter post_id
$post_id = acf_get_valid_post_id( $post_id );
// get field
$field = acf_maybe_get_field( $selector, $post_id, false );
<html>
<head>
<title>How to tile a kitchen backsplash</title>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "HowTo",
"name": "How to tile a kitchen backsplash",
"description": "Any kitchen can be much more vibrant with a great tile backsplash. This guide will help you install one with beautiful results, like our example kitchen seen here.",
"image": {
@ziodave
ziodave / functions.php
Last active October 25, 2018 09:36
Use $_SERVER['host'] as URL
<?php
add_filter( 'wl_website_jsonld', function( $jsonld ) {
$schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet
$url = $schema . $_SERVER['HTTP_HOST'] . '/';
$jsonld['@id'] = "$url#website";
$jsonld['url'] = "$url";
@ziodave
ziodave / functions.php
Last active October 24, 2018 09:40
Add WebSite mark-up on category pages
<?php
add_filter( 'wp_head', function() {
// Bail out if it's not a category.
if ( ! is_category() ) {
return;
}
// Check that the Wordlift_Jsonld_Service exists.
@ziodave
ziodave / gist:da1cc1c3575adb0cd61f
Last active December 31, 2015 14:47 — forked from belackriv/gist:008087f6f005aee1167f
Marrionette Table without composite view
//
//Regions
//
var NoWrapRegion = Backbone.Marionette.Region.extend({
attachHtml: function (view) {
this.el.innerHTML="";
var children = view.el.childNodes;
while (children.length > 0) {
this.el.appendChild(children[0]);
2015-10-08 17:33:03.151 INFO 24176 --- [ool-1-thread-10] tv.helixware.mico.services.PartService : Current annotation object:
Annotation{resource='http://demo2.mico-project.eu:8080/marmotta/b6e0d091-8590-4a86-895e-89a589d654a7', body=Body{resource=http://demo2.mico-project.eu:8080/marmotta/dd187308-e66f-4a03-9a49-6364e7e33044'}, targets=Target{resource='http://demo2.mico-project.eu:8080/marmotta/16ceeb33-39d8-4494-bb73-18c4b1bc5642'}, motivatedBy=null, serializedBy=null, serializedAt='null', annotatedBy=Software{resource='http://demo2.mico-project.eu:8080/marmotta/b178389e-385a-428e-9748-b70cb73e509b', name='http://www.mico-project.eu/broker/injection-web-service', homepage='null'}, annotatedAt='2015-10-08 16:32:07.957'}
2015-10-08 17:33:04.500 INFO 24176 --- [ool-1-thread-10] o.o.r.o.m.helpers.SimpleRoleMapper : Unregistered type http://www.mico-project.eu/ns/platform/1.0/schema#ContentPart
2015-10-08 17:33:05.119 INFO 24176 --- [ool-1-thread-10] tv.helixware.mico.services.PartService : Current
2015-09-16 14:02:47.762 INFO --- [ main] t.helixware.plugins.mico.MicoClientTest : Current annotation object:
Annotation{resource='http://demo2.mico-project.eu:8080/marmotta/5ba6db49-4968-48ca-8f5b-afe3127b3b15', body=Body{resource=http://demo2.mico-project.eu:8080/marmotta/e179be4c-964b-431b-a7a4-c9c3184b5fa9'}, target=Target{resource='http://demo2.mico-project.eu:8080/marmotta/58a97bcb-a05c-4765-8856-8f04435009d0'}, motivatedBy=null, serializedBy=null, serializedAt='null', annotatedBy=Software{resource='http://demo2.mico-project.eu:8080/marmotta/066b7cc1-b8f4-46e9-955c-8c4e77a128e9', name='http://www.mico-project.eu/broker/injection-web-service', homepage='null'}, annotatedAt='2015-09-16 13:01:59.161'}
2015-09-16 14:02:49.934 INFO --- [ main] t.helixware.plugins.mico.MicoClientTest : Current annotation object:
Annotation{resource='http://demo2.mico-project.eu:8080/marmotta/17d9e69a-8985-4f5c-93fd-ac643a218635', body=Body{resource=http://demo2.mico-project.eu:8080/marmotta/01f
@ziodave
ziodave / collectd-stockholm
Created March 9, 2015 14:03
collectd-stockholm
{
"title": "collectd-stockholm",
"services": {
"query": {
"list": {
"0": {
"query": "plugin: \"cpu\" AND plugin_instance: \"0\" AND host:\"stockholm\"",
"alias": "cpu1",
"color": "#7EB26D",
"id": 0,