Skip to content

Instantly share code, notes, and snippets.

Pierre Baron prbaron

Block or report user

Report or block prbaron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ec54fa4d0901c9f7ea81
/**
* 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 Aug 29, 2015 — forked from ludder/slideDown.js
Vanilla JavaScript slideUp and slideDown functions
View slideDown.js
/*
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
View main.js
//
// 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 Aug 29, 2015
jQuery plugin template
View plugin.js
/**
* 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
Export Database into a SQL file with CakePHP
View Setting.php
<?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 Dec 16, 2015
Improved core.php file for CakePHP Change the debug level whether you are in local or production mode.
View core.php
<?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 Dec 16, 2015
Improved database.php file for CakePHP This file chooses the good database configuration whether you are in local or production mode.
View database.php
<?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 Dec 16, 2015
Code from Html5Boilerplate
View Remove console error from IE8-
// 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 Dec 12, 2015
Add your Twitter timeline to your CakePHP website. I also included The MVC for your website.
View PBTwitter.php
<?php
/**
*
* Twitter class to display your tweets in a CakePHP application
*
*
* @author Pierre Baron <prbaron22@gmail.com>
*
* @copyright 2012-2012 Pierre Baron
You can’t perform that action at this time.