Skip to content

Instantly share code, notes, and snippets.

@pikilon
pikilon / gist.js
Last active November 22, 2020 14:21
Frontity WP shortcodes processors
import React from "react";
import Gist from "react-gist";
import { testShortCode, getShortCodeProps } from "./shortcode-utils";
const gist = {
name: "gist",
priority: 10,
test: ({ node }) => testShortCode(node, "gist"), //👈 [gist ]
processor: ({ node }) => {
/*
import * as functions from 'firebase-functions'
import * as express from 'express'
import * as cors from 'cors'
// give us the possibility of manage request properly
const app = express()
// Automatically allow cross-origin requests
app.use(cors({ origin: true }))
@pikilon
pikilon / Bootstrap addon better grid (add it before the bootstrap library).markdown
Created May 27, 2016 08:21
Bootstrap addon better grid (add it before the bootstrap library)

Bootstrap addon better grid (add it before the bootstrap library)

An easy and fast way to make same columns width and without gap

A Pen by Pikilon on CodePen.

License.

@pikilon
pikilon / wp-lazyresponsive.php
Last active February 11, 2018 02:45
Wordpress lazysizes implementation for image attachments
<?
/**
* Get all the info we can get from a WP attachment
* @param int $img_id attachment id of the image to obtain the info
* @return an associative array with all the info of the image
*/
function get_all_image_info($img_id) {
$img = wp_get_attachment_metadata($img_id);
//we add the original source info to the sizes array given in the previous function