Skip to content

Instantly share code, notes, and snippets.

@setola
setola / index.php
Created July 14, 2017 15:22
CSV to RewriteRule
<?php
$inHandler = fopen("in.csv", "r");
$outHandler = fopen("out.txt", "w");
$row = 0;
while (($data = fgetcsv($inHandler, 1000, ",")) !== FALSE) {
$row++;
if (1 == $row) continue;
@setola
setola / index.php
Created March 23, 2017 11:37
import customers prestohop -> woocommerce
<?php
/**
* Created by PhpStorm.
* User: setola
* Date: 22/02/17
* Time: 10.09
*/
$sql = <<<SQL
SELECT
@setola
setola / main.js
Created May 24, 2016 16:24
A simple way to integrate external controls to Bootstrap carousel
/**
* Just an object used for name spacing
*/
var agitaLab = {};
/**
* Two ways binding between an external "carousel-control like"
* element and the carousel slides.
* Remember to add data-item-no to your carousel :)
*/
@setola
setola / nibirumail.cookie.js
Created May 13, 2015 21:09
Nibirumail Cookie Policy for jQuery noConflict
@setola
setola / designer.html
Last active August 29, 2015 14:19
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
<?php
// First we remove all the shortcodes from the post body
add_action('the_content', 'strip_shortcodes');
get_template_part('header');
?>
<div id="main-container" class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
@setola
setola / custom-post-password-template.php
Created February 20, 2015 15:47
WordPress customize post password authentication system
<?php
/*
Template Name: Custom Password
*/
/**
* Checks if the given code has a valid format ex: AB123456789
* @param $code string the code
* @return bool true only if code is valid
@setola
setola / functions.php
Last active August 29, 2015 14:15
WordPress invert post dates
<?php
$articles = get_posts(array(
'post_type' => MY_CUSTOM_POST_TYPE,
'numberposts' => -1
));
$date = array();
foreach($articles as $art){
$date[] = array($art->post_date_gmt, $art->post_date);
@setola
setola / Google-Maps-paddings.markdown
Last active August 29, 2015 14:07
A Pen by Emanuele Tessore.
@setola
setola / test.html
Created August 29, 2014 14:20
Test for Banana Tool :)
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Tests for Banana Tool</title>
<link rel='stylesheet'
test='file from external cdn without scheme'
id='reset-css'
href='//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.0/normalize.min.css'
type='text/css'