Skip to content

Instantly share code, notes, and snippets.

Avatar

keopx keopx

View GitHub Profile
View example.jquery.js
(function($){
$.fn.extend({
example: function(options) {
var defaults = {
color: '#000000',
}
View debug.md

Start by logging into MySQL as root:

mysql -u root

Enter the following SQL statements:

SET GLOBAL query_cache_type=OFF;
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 mymodule.info
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
View checklist.md
View policy.drush.inc
<?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')) {
View docker-wipe.sh
#!/bin/bash
docker stop `docker ps -aq`
docker rm `docker ps -aq`
docker rmi `docker images -aq`
View create_menu_link.php
View import-files.php
<?php
$file = system_retrieve_file($remote_file_url);
$node->field_image[$node->language][] = (array) $file;
node_save($node);