Skip to content

Instantly share code, notes, and snippets.

View a-barbieri's full-sized avatar
🛸
glidin

Alessandro a-barbieri

🛸
glidin
View GitHub Profile
@a-barbieri
a-barbieri / server.js
Created July 13, 2020 15:10 — forked from edolyne/server.js
Dynamic Sitemap creation for NextJS based projects
const express = require('express');
const next = require('next');
const sm = require('sitemap');
const axios = require('axios');
const port = parseInt(process.env.PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
@a-barbieri
a-barbieri / README.md
Last active October 6, 2021 09:37
WP_GraphQL Relevanssi Plugin

WP_GraphQL Relevanssi Plugin

A plugin to enable Relevanssi research through WP_GraphQL.

Requirements

This plugin requires Relevanssi >= 4.6.0 and WP_GraphQL >= 0.8.0.

GraphQL query format

@a-barbieri
a-barbieri / loop-per-pyetro.php
Last active November 11, 2019 14:28
Per Pyetro
<?php if (have_posts()): ?>
<ul id="image-data-list">
<?php while(have_posts()): the_post(); ?>
<li data-image-url="<?= your_post_image_url ?>"></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
@a-barbieri
a-barbieri / MyComponent.js
Last active March 21, 2019 15:40
Saga sequence
import React, { Component } from "react";
import { getFirstAndSecondAction } from "actions/getFirstAndSecondAction";
class MyComponent extends Component {
static async getInitialProps({ store }) {
// Trigger the saga sequence
store.dispatch(getFirstAndSecondAction());
return {};
@a-barbieri
a-barbieri / cult.jpg.md
Last active November 28, 2018 15:19
WordPress Plugin to apply a filter and clone every image uploaded.
@a-barbieri
a-barbieri / README.md
Last active June 6, 2021 21:48
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@a-barbieri
a-barbieri / README.md
Created July 16, 2018 13:27 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@a-barbieri
a-barbieri / gist:96935a129a628cc054df5cc8bb47328f
Created February 28, 2018 10:15 — forked from tylerlee/gist:53609bff1346cebf8f0a85b6be29a88e
whitelist for uploads: extensions and mimetypes
{
// Image Formats
"jpg": "image/jpeg",
"jpeg": "image/jpeg",
"gif": "image/gif",
"png": "image/png",
"bmp": "image/bmp",
"tiff": "image/tiff",
"tif": "image/tiff",
@a-barbieri
a-barbieri / pixi-filters.js
Created October 5, 2017 07:48
PIXI filters to be used in CODEPEN examples updated 05/10/2017
/*!
* pixi-filters - v2.0.2
* Compiled Thu, 21 Sep 2017 16:00:59 UTC
*
* pixi-filters is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :