Skip to content

Instantly share code, notes, and snippets.

@real34
real34 / composer.json
Last active October 10, 2015 09:57
Illustration basique de tri d'un tableau de périodes et de fusion des périodes successives
{
"name": "real34/agist",
"description": "Sample composer file to proving hosting micropackages on Gists works",
"license": "MIT",
"autoload": {
"classmap": ["."]
}
}
@real34
real34 / APC-Recipe.rb
Created June 22, 2012 13:26
Capistrano : APC recipe to deal with Apache APC cache
##
# APC recipe
# => convenience rules for dealing with APC in applications
##
_cset(:apc_webroot) { "" }
namespace :apc do
desc <<-DESC
Create a temporary PHP file to clear APC cache, call it (using curl) and removes it
@real34
real34 / plugins.js
Created May 23, 2012 09:03
Small JS plugins for use across applications
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}};
// make it safe to use console.log always
(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}})
(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());
// place any jQuery/helper plugins in here, instead of separate, slower script files.
@real34
real34 / ActionsHelper.php
Created April 12, 2012 08:16
CakePHP2.x : Twitter bootstrap base for projects
<?php
/**
* Action Helper
* Allows to generate simple CRUD links for a given object and customize its rendering
* It only works for default baked urls
*
* Usage:
* <code>
* $this->Actions->setActionsOptions($order['Order']['id'], true);
* echo $this->Actions->view();
@real34
real34 / HttpAuth-Recipe.rb
Created April 5, 2012 12:33
Capistrano : Http Authentification recipe - Generates htaccess/htpasswd Apache protection for your project
##
# HTTP Authentification deployment Recipe
# => Add htaccess password protection when deploying, with the correct htpassword file for the passed users
##
_cset (:http_auth_users) {[
["admin", "password"]
]}
_cset (:http_auth_path) { "" } # Path of the directory to add http auth, from the release root
namespace :httpAuth do
@real34
real34 / CakePHP-Recipe.rb
Created April 5, 2012 12:29
Capistrano : CakePHP2.x deployment recipe
##
# CakePHP2.x deployment recipe
# TODO Implement a way to revert migrations given the map.php files of a previous release
# TODO Make a difference between tmp files and others
# TODO Give a way to the application to define its own custom directories
##
_cset (:app_symlinks) { [
"/webroot/cache_css", "/webroot/cache_js",
"/tmp"
] }
@real34
real34 / email.php
Created March 15, 2012 08:45
CakePHP : 1.3 - Email task to use the Email component from a Shell
<?php
App::import('Core', 'Controller');
App::import('Component', 'Email');
/**
* Task permitting to use the Email component from a shell
* @see http://bakery.cakephp.org/articles/view/emailcomponent-in-a-cake-shell
*/
class EmailTask extends Shell {
/**
* Controller class
@real34
real34 / delayedCall.js
Created March 14, 2012 14:01
Javascript : DelayedCall - prevent a callback to be triggered before a delay of inactivity
/**
* Class allowing to call a method only after a specific delay if no other call was made
* It is useful to prevent triggering the same callback multiple times quickly. For instance
* ajax calls on keyup. It introduces a delay before triggering the callback
*
* Usage:
* var refreshResults = new DelayedCall(1000, function() { alert('Mouse not moved for 1 second'); })
* $('body').mousemove(function() { refreshResults.trigger(); })
*
* @param delay Inactivity delay in millisecond before triggering the callback
@real34
real34 / CakePHP-Recipe.rb
Created February 23, 2012 13:58
Capistrano : CakePHP1.x deployment recipe
##
# CakePHP deployment recipe
# TODO Implement a way to revert migrations given the map.php files of a previous release
# TODO Make a difference between tmp files and others
# TODO Give a way to the application to define its own custom directories
##
_cset (:app_symlinks) { [
"/webroot/cache_css", "/webroot/cache_js",
"/tmp"
] }
@real34
real34 / WIO_Gmap.csv
Created November 18, 2011 14:32
Magento : French translation of Magento's Google Map Locations extension (from webideaonline)
Gmap Locations Configuration Configuration de Gmap Locations
Google Map API key Clé d'API Google Map
You can get it here http://code.google.com/apis/maps/signup.html. eg.ABQIAAAA8Y84y7AfnkshoyWtI5fyShQikMkOUW3vCdojO3o0Jxipwb7AThTTtKgn8GKXuPGojAtR759m5cLSww Vous pouvez en obtenir une ici http://code.google.com/apis/maps/signup.html. ex:ABQIAAAA8Y84y7AfnkshoyWtI5fyShQikMkOUW3vCdojO3o0Jxipwb7AThTTtKgn8GKXuPGojAtR759m5cLSww
Search Configuration Configuration de la Recherche
Show Search block Afficher le bloc de Recherche
Show Search Radius Circle Afficher le Cercle du Rayon de Recherche
in search mode shows colored circle for searched radius on map lors du mode de recherche afficher un cercle de couleur pour le rayon recherché sur la carte
Search Circle Radius Color Couleur du Cercle du Rayon de Recherche
Front End Title Titre Front End
You can leave it blank if not need Laissez vide si vous n'en n'avez pas besoin