Skip to content

Instantly share code, notes, and snippets.

Avatar

keopx keopx

View GitHub Profile
@keopx
keopx / install_package.sh
Last active Aug 26, 2015
Image optimization for web
View install_package.sh
sudo apt-get install libjpeg-progs pngcrush
View example.jquery.js
(function($){
$.fn.extend({
example: function(options) {
var defaults = {
color: '#000000',
}
View videodesk_importer.module
<?php
function videodesk_importer_menu() {
$items = array();
$items['admin/config/content/videodesk_importer'] = array(
'title' => 'Videodesk importer',
'description' => 'Configuration for Videodesk importer module',
'page callback' => 'drupal_get_form',
'page arguments' => array('videodesk_importer_form'),
'access arguments' => array('access administration pages'),
View debug.md

Start by logging into MySQL as root:

mysql -u root

Enter the following SQL statements:

SET GLOBAL query_cache_type=OFF;
@keopx
keopx / Classes.php
Last active Aug 29, 2015
PHP Classes: when to use :: vs. ->
View Classes.php
<?php
/**
* Simply put, :: is for class-level properties, and -> is for object-level properties.
* If the property belongs to the class, use ::
* If the property belongs to an instance of the class, use ->
*/
class Tester
{
public $foo;
View sitename-change-D7.sql
-- Verificar donde existe
SELECT *
FROM `variable`
WHERE `value` LIKE '%sites%'
LIMIT 0 , 30;
-- Modificar las variables de sites
UPDATE variable SET file_public_path = REPLACE(file_public_path, 'www.example.com', 'www.drupalexample.com');
UPDATE variable SET file_private_path = REPLACE(file_private_path, 'www.example.com', 'www.drupalexample.com');
View move.sh
cd sites/example
drush -v sqlq 'UPDATE system SET filename = REPLACE(filename, "example", "example2")'
mv sites/example sites/example2
drush rr -v # This is Registry Rebuild Drush command
# Then, browse your code and search for URLs containing sites/example.
View upgradepath.drush.inc
<?php
/**
* @file
* Runs a set of steps to upgrade a database to be in line with code.
*/
/**
* Implements hook_drush_command().
*/
function upgradepath_drush_command() {
View Temas_introduccion_D7.txt
- Menu example
-- Tabs
-- Callback
- Page example
-- Permissions
- Block example
- Form example
-- Validate
-- Submit
-- Autocomplete
View mymodule.info
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc