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.
{
"title": "collectd-rome",
"services": {
"query": {
"list": {
"0": {
"query": "plugin: \"cpu\" AND plugin_instance: \"0\" AND host:\"rome\"",
"alias": "cpu1",
"color": "#7EB26D",
"id": 0,
@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]);
@ziodave
ziodave / postgresql.sql
Created August 1, 2013 12:09
postgresql.sql for the dbscripts folder of WSO2 Identity Server
CREATE TABLE IDN_BASE_TABLE (
PRODUCT_NAME VARCHAR(20),
PRIMARY KEY (PRODUCT_NAME)
);
INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server');
CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
CONSUMER_KEY VARCHAR(255),
CONSUMER_SECRET VARCHAR(512),
@ziodave
ziodave / cgminer.rb
Created April 3, 2013 06:00
cgminer formula that works on MacBook Pro.
require 'formula'
class Cgminer < Formula
homepage 'https://github.com/ckolivas/cgminer'
url 'https://github.com/ckolivas/cgminer/archive/v2.11.0.tar.gz'
sha1 '56f7d2bed9b51a3a9b6cafacb09c10de552f5e82'
version '2.11'
depends_on 'automake' => :build
depends_on 'curl'