Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
(function($){
$.fn.extend({
example: function(options) {
var defaults = {
color: '#000000',
}
@keopx
keopx / debug.md
Created August 20, 2014 15:54 — forked from juampynr/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 / move.sh
Last active August 29, 2015 14:06 — forked from juampynr/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.
<?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() {
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
@keopx
keopx / checklist.md
Last active August 29, 2015 14:07 — forked from juampynr/checklist.md
<?php
/**
* Implement of drush_hook_COMMAND_validate().
*
* Prevent catastrophic sql-sync to live. Note that this file has to be local to the
* machine that intitiates sql-sync command.
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
if (strstr($destination, '.prod')) {
#!/bin/bash
docker stop `docker ps -aq`
docker rm `docker ps -aq`
docker rmi `docker images -aq`
<?php
$file = system_retrieve_file($remote_file_url);
$node->field_image[$node->language][] = (array) $file;
node_save($node);