Skip to content

Instantly share code, notes, and snippets.

View yoanmarchal's full-sized avatar
💭
I may be slow to respond.

Marchal yoan yoanmarchal

💭
I may be slow to respond.
View GitHub Profile
{* Structured Data Json - LD Microdata for Prestashop 1.6.X & 1.7
*
* Add this code in your smarty global.tpl/header.tpl file to show Organization, WebPage, Website and Product Microdata in ld+json format.
* Requires Prestashop 'productcomments' module for review stars ratings.
* by Ruben Divall @rubendivall http://www.rubendivall.com
* Module by @atomiksoft: https://addons.prestashop.com/en/seo-natural-search-engine-optimization/24511-microformats-in-ldjson.html
*}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
@yoanmarchal
yoanmarchal / youtube-vimeo-embed-urls.php
Created November 7, 2012 10:50 — forked from cballou/youtube-vimeo-embed-urls.php
PHP Function to Convert Youtube and Vimeo URLs to Lightbox-Ready Equivalents
<?php
/**
* Given a string containing any combination of YouTube and Vimeo video URLs in
* a variety of formats (iframe, shortened, etc), each separated by a line break,
* parse the video string and determine it's valid embeddable URL for usage in
* popular JavaScript lightbox plugins.
*
* In addition, this handler grabs both the maximize size and thumbnail versions
* of video images for your general consumption. In the case of Vimeo, you must
* have the ability to make remote calls using file_get_contents(), which may be
@yoanmarchal
yoanmarchal / weather.json
Created April 28, 2019 11:00
sample-data
[
{
"time": 1514782800,
"summary": "Clear throughout the day.",
"icon": "clear-day",
"sunriseTime": 1514809280,
"sunsetTime": 1514842810,
"moonPhase": 0.48,
"precipIntensity": 0,
"precipIntensityMax": 0,
### Keybase proof
I hereby claim:
* I am yoanmarchal on github.
* I am yoanm (https://keybase.io/yoanm) on keybase.
* I have a public key ASBOWT4vUafJvDYXcXgmLfEJp9xnwofM-vwOWYJbq9yvEQo
To claim this, I am signing this object:
@yoanmarchal
yoanmarchal / README.md
Created January 29, 2019 10:08
SCRIPT-8
@yoanmarchal
yoanmarchal / jsce
Last active November 21, 2016 11:40
class create custom element
'use strict';
class extends HTMLElement {
createdCallback() {
}
attachedCallback(){
}
function generateCsv($data, $delimiter = ',', $enclosure = '"') {
$handle = fopen('php://temp', 'r+');
foreach ($data as $line) {
fputcsv($handle, $line, $delimiter, $enclosure);
}
rewind($handle);
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
var router = (function () {
"use strict";
var routes = [];
function addRoute(route, handler) {
routes.push({parts: route.split('/'), handler: handler});
}
@yoanmarchal
yoanmarchal / parallelize.php
Created March 29, 2016 08:46 — forked from leowebguy/parallelize.php
Parallelize downloads across hostnames for WordPress. Useful to boost static resources load speed on websites. Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
<?php
/******
Parallelize downloads across hostnames for WordPress.
Useful to boost static resources load speed on websites.
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
See full post > http://northeastcode.com/?p=2438
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex:
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg
@yoanmarchal
yoanmarchal / pretty_print.php
Created June 27, 2013 12:47
Pretty print - PHP
function pretty_print($arg) {
echo '<pre>';
print_r($arg);
echo '</pre>';
}
/* using pretty print */
$var = $_SERVER;
pretty_print($var);