Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐎 of course a horse

Alessandro a-barbieri

💭
🐎 of course a horse
View GitHub Profile
@a-barbieri
a-barbieri / server.js
Created Jul 13, 2020 — forked from edolyne/server.js
Dynamic Sitemap creation for NextJS based projects
View server.js
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 Apr 4, 2020
WP_GraphQL Relevanssi Plugin
View README.md

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

View loop-per-pyetro.php
<?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; ?>
View MyComponent.js
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 Nov 28, 2018
WordPress Plugin to apply a filter and clone every image uploaded.
View cult.jpg.md
@a-barbieri
a-barbieri / README.md
Last active Dec 17, 2020
NextJS sitemap generator with dynamic URL
View README.md

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
View gist:96935a129a628cc054df5cc8bb47328f
{
// Image Formats
"jpg": "image/jpeg",
"jpeg": "image/jpeg",
"gif": "image/gif",
"png": "image/png",
"bmp": "image/bmp",
"tiff": "image/tiff",
"tif": "image/tiff",
View Capybara-Rspec-Rails-assets-pipeline.md
@a-barbieri
a-barbieri / pixi-filters.js
Created Oct 5, 2017
PIXI filters to be used in CODEPEN examples updated 05/10/2017
View pixi-filters.js
/*!
* 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) :