Navigation Menu

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
@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(){
}
{* 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",
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 / php
Created November 9, 2015 10:32
generate admin wordpress from FTP
function add_admin_acct(){
$login = 'yourlogin';
$passw = 'yourpassword';
$email = 'email@gmail.com';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $login, $passw, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
@yoanmarchal
yoanmarchal / slider.php
Created September 24, 2015 10:16
get img from page / article (wordpress)
<?php
$id = get_the_id();
$attachments = get_attached_media( 'image', $id );
if(empty($attachments)){
?>
<div class="slider" data-url=["http:\/\/lescaladaulemosi.fr\/wp-content\/uploads\/2015\/07\/home-compressor.jpg"]>
</div>
<?php
} else {
var polys = document.querySelectorAll('polygon,polyline');
[].forEach.call(polys,convertPolyToPath);
function convertPolyToPath(poly){
var svgNS = poly.ownerSVGElement.namespaceURI;
var path = document.createElementNS(svgNS,'path');
var points = poly.getAttribute('points').split(/\s+|,/);
var x0=points.shift(), y0=points.shift();
var pathdata = 'M'+x0+','+y0+'L'+points.join(' ');
if (poly.tagName=='polygon') pathdata+='z';