Skip to content

Instantly share code, notes, and snippets.

@remyzv
remyzv / Readme
Last active August 29, 2015 13:57
Install WordPress best practices
1ère étape côté serveur :
Redirection du sous domaine vers le serveur dedié OVH :
- Zone DNS => Modification zone Type A blog.frozened.me, redirigé vers l'IP du serveur dédié
Création du vHost sur serveur
- Explication interet vHost et fonctionnement
@remyzv
remyzv / prestashop_language.tpl
Last active August 29, 2015 13:57
Afficher drapeaux langues dispo dans prestashop
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;">
<input class="" size="43" type="text" id="name_{$language.id_lang}" name="name_{$language.id_lang}"
value="{$product->name[$language.id_lang]|htmlentitiesUTF8|default:''}"/>
<sup> *</sup>
<span class="hint" name="help_box">
{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span>
</span>
</div>
@remyzv
remyzv / date.js
Last active August 29, 2015 13:57
Utiliy function for js date
function parseDate(date) {
var year = parseInt(date.substring(0,4));
var month = parseInt(date.substring(4,6));
month = (month < 10) ? '0' + month : month;
month = month-1;
var day = parseInt(date.substring(6,9));
day = (day < 10) ? '0' + day : day;
return new Date(year,month,day);
}
@remyzv
remyzv / json.js
Created March 17, 2014 14:00
Wordpress Json
$('.oneVideo').click(function(){
$('.oneVideo').removeClass('active');
$(this).addClass('active');
var id = $(this).attr('data-id');
var json = $.getJSON('http://Tigresdegarges.com/?p='+ id +'&json=1').done(function(response){
var post = response.post;
console.log(post);
var customfields = post.custom_fields;
@remyzv
remyzv / workflow.md
Last active August 29, 2015 13:57
Different workflows

Drush

Installer drush sur la VM

  • sudo su
  • apt-get install drush

Installer un module avec Drush

  • cd /var/www/isi2014
  • drush dl nom_module (telecharge)
  • drush en nom_module (activation)
@remyzv
remyzv / vagrand.md
Last active August 29, 2015 13:57
Installation Vagrant sur windows
<?php
App::uses('AppController', 'Controller');
App::uses('Folder', 'Utility');
App::uses('File', 'Utility');
App::uses('CakeTime', 'Utility');
class ExempleController extends AppController {
public function implementedEvents()
{
@remyzv
remyzv / centerabsolute
Created May 28, 2014 13:16
Center an absolute div
.logo-header {
position:absolute;
left:50%;
}
.logo-header img {
position:relative;
left:-50%;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" />
@remyzv
remyzv / capistrano
Created June 13, 2014 08:48
Capistrano cmd lines
desc "Database link"
task :bd_link do
on roles(:all) do |host|
within release_path do
execute :ln, '-s', "#{shared_path}/database.php", 'app/Config/database.php'
execute :rm, '-fr', 'app/Config/core.php'
execute :ln, '-s', "#{shared_path}/core.php", 'app/Config/core.php'
execute :rm, '-fr', 'app/webroot/files'