This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export database. | |
drush sql-dump > ~/my-sql-dump-file-name.sql | |
# Import database. | |
drush sql-cli < backup.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Renames a function | |
*/ | |
function yourmodule_default_theme_settings() { | |
$new_variable_name = variable_get('old_variable_name', NULL); //Loads the variable to be renamed from drupal's variables table and assigns it to a new one. | |
variable_set('new_variable_name', $new_variable_name); //Stores $new_variable_name into drupal's variables table. | |
variable_del('old_variable_name'); //Deletes the old variable from drupal's variables table | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<style class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="es_ES" xmlns="http://purl.org/net/xbiblio/csl"> | |
<!-- This style was edited with the Visual CSL Editor (http://editor.citationstyles.org/visualEditor/) --> | |
<info> | |
<title>UNE 50-104-94</title> | |
<id>http://www.zotero.org/styles/une-50-104-94</id> | |
<link href="https://gist.github.com/ccamara/6580003" rel="self"/> | |
<link href="http://www.aenor.es/aenor/normas/normas/fichanorma.asp?tipo=N&codigo=N0005073&PDF=Si#.UjbzZKxTlhE" rel="documentation"/> | |
<author> | |
<name>Carlos Cámara</name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush php-eval 'print_r(module_implements("hook_name"))' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a copy of current database, deletes it and syncs it with dev | |
drush ard && drush sql-drop && drush sql-sync @site.dev @site.local | |
# Sync files | |
drush rsync @site.dev:%files @site.local:%files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//More info: http://css-tricks.com/how-nth-child-works/ | |
ul li:nth-child(3n+3) { | |
color: #ccc; | |
} | |
ul li:nth-child(5) { | |
color: #ccc; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.background-image { | |
background: image-url('image-name.png'); //image-url() is defined in config.rb file so its prefered | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
# Autocompletion for git. | |
# http://code-worrier.com/blog/autocomplete-git/ | |
# Download doing curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Creates 'nodetype' pages. | |
* | |
* @param array $content | |
* Assoc array with machine names as key and node title. | |
*/ | |
function yourmodule_create_nodetype($content) { | |
foreach ($content as $machine_name => $content_item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function theme_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'search_block_form') { | |
$form['search_block_form']['#title'] = t('Search'); // Change the text on the label element | |
$form['search_block_form']['#title_display'] = 'invisible'; // Toggle label visibilty | |
//$form['search_block_form']['#size'] = 40; // define size of the textfield | |
$form['search_block_form']['#default_value'] = t('Search'); // Set a default value for the textfield | |
//$form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button | |
$form['actions']['submit']['#value'] = decode_entities(''); // Uses a unicode code (eg. useful when using awesomefonts) | |
//$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/immagini/btnCerca.png'); // Adds an image |