Skip to content

Instantly share code, notes, and snippets.

@GoZOo
GoZOo / gitignore global mac
Created September 17, 2012 09:59
Gitignore global Mac
*~
.DS_Store
.idea
@GoZOo
GoZOo / .bashrc git mac
Last active October 12, 2017 09:32
Couleur et branch dans le prompt Mac Fichier .bashrc
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-*color)
c_cyan=`tput setaf 6`
c_blue=`tput setaf 4`
@GoZOo
GoZOo / gist:3781074
Created September 25, 2012 10:26
redéfinir le fil d'ariane pour prendre en compte le bon element de menu
/*
Définition du Breadcrumb en fonction d'un Node
*/
function _breadcrumb_for_a_node($link_path = NULL){
$breadcrumb = array();
if(!is_null($link_path)){
$breadcrumb[] = l(t('Home'), '<front>');
@GoZOo
GoZOo / gist:4268937
Created December 12, 2012 15:56
Add class and attributes from custom blocks
/*
* Add class and attributes from custom blocks
*/
function phptemplate_preprocess_block(&$vars) {
if(isset($vars['block']->attributes)) {
if(isset($vars['block']->attributes['class'])) {
$vars['classes_array'] = array_merge($vars['classes_array'], $vars['block']->attributes['class']);
unset($vars['block']->attributes['class']);
}
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
@GoZOo
GoZOo / touchmenu.js
Last active December 15, 2015 00:08
Implement touch for tablets and mobile on menu hover
// true if we are in touch screen
var isTouch = ('ontouchstart' in window) ||
window.DocumentTouch && document instanceof DocumentTouch;
/*========
= Primary Menu
========*/
Drupal.angers.primarymenu = function(selector){
@GoZOo
GoZOo / regenerateCacheBoost.bash
Created March 18, 2013 16:41
Re-générer le cache boost via un crontab se basant sur le sitemap xml.
#!/bin/bash
# Drupal cron
wget -O - -o /dev/null http://example.com/cron.php?cron_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Visit every page from your sitemap.xml
wget --quiet http://example.com/sitemap.xml --output-document - | egrep -o "http://example.com/[^<]+" | wget -q --delete-after -i -
@GoZOo
GoZOo / drupal-file-template.info
Last active December 15, 2015 13:49
Drupal .info, .module and .install templates for PhpStorm File Template
name =
description =
core = 7.x
package = Other
;dependencies[] =
;files[] =
;configure =
;stylesheets[all][] =
@GoZOo
GoZOo / createUserVirtualhostDb.bash
Last active December 15, 2015 16:49
Script bash pour créer un utilisateur, son virtualhost (avec SSL) et sa base de données. Nécessite que le fichier à partir duquel la configuration VirtualHost existe déjà (/root/apache2-default et /root/apache2-default-ssl) Idem pour le .bashrc : /etc/root/.bashrc-default
#! /bin/bash
######################
## Script de création de virtualhost + utilisateur + base de données
######################
## /!\ Penser a modifier [ROOTPASSWORD] pour mysql
######################
## USER
# Prompt user informations
@GoZOo
GoZOo / vset_local.sh
Created April 9, 2013 12:31
script to re-configure development variables after database update
#!/bin/bash
# MOBILE
drush vset mobile_tools_mobile_url "http://m.local.mysite.com"
drush vset mobile_tools_desktop_url "http://local.mysite.com"
# modules
drush dl -y dummyimage
drush en -y devel dummyimage
# dummyimage