Skip to content

Instantly share code, notes, and snippets.

@prbaron
prbaron / gist:ec54fa4d0901c9f7ea81
Created November 3, 2015 22:21 — forked from benoitboucart/gist:f80090c87fa97f4e4098
How to use Jekyll with Gulp
/**
* For more information see this tutorial: http://blog.webbb.be/use-jekyll-with-gulp/
*
* Libs import
* --> How to install? npm install --save-dev gulp-minify-html
* @type {[type]}
*/
var gulp = require('gulp'),
path = require('path'),
@prbaron
prbaron / slideDown.js
Last active August 29, 2015 14:27 — forked from ludder/slideDown.js
Vanilla JavaScript slideUp and slideDown functions
/*
Element to slide gets the following CSS:
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.4s ease 0s;
*/
/**
* Like jQuery's slideDown function - uses CSS3 transitions
//
// Get the breakpoint
//
var breakpoint = {};
breakpoint.refreshValue = function () {
this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/"/g, '');
};
//
@prbaron
prbaron / plugin.js
Last active August 29, 2015 14:15
jQuery plugin template
/**
* new plugin template
*
* to call it $('#myElement').pluginTitle();
*/
(function( $ ){
$.fn.pluginTitle = function(options) {
// get the called element
var $container = $(this);
@prbaron
prbaron / Setting.php
Created May 17, 2013 12:50
Export Database into a SQL file with CakePHP
<?php
class Setting extends AppModel {
public $useTable = false;
/**
* Exporte la base de donnees dans un format .sql
* un fichier est cree dans App/webroot/files/sql_dump
* un autre fichier est telecharge dans par le navigateur
*
@prbaron
prbaron / core.php
Last active December 16, 2015 10:49
Improved core.php file for CakePHP Change the debug level whether you are in local or production mode.
<?php
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, models refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
@prbaron
prbaron / database.php
Last active December 16, 2015 10:49
Improved database.php file for CakePHP This file chooses the good database configuration whether you are in local or production mode.
<?php
/**
* This is core configuration file.
*
* Use it to configure core behaviour of Cake.
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
@prbaron
prbaron / Remove console error from IE8-
Last active December 16, 2015 10:49
Code from Html5Boilerplate
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
@prbaron
prbaron / PBTwitter.php
Last active December 12, 2015 05:59
Add your Twitter timeline to your CakePHP website. I also included The MVC for your website.
<?php
/**
*
* Twitter class to display your tweets in a CakePHP application
*
*
* @author Pierre Baron <prbaron22@gmail.com>
*
* @copyright 2012-2012 Pierre Baron