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
(function($, Drupal){ | |
// Our function name is prototyped as part of the Drupal.ajax namespace, adding to the commands: | |
Drupal.ajax.prototype.commands.custom_javascript_function = function(ajax, response, status) { | |
// The value we passed in our Ajax callback function will be available inside the | |
// response object. Since we defined it as selectedValue in our callback, it will be | |
// available in response.selectedValue. Usually we would not use an alert() function | |
// as we could use ajax_command_alert() to do it without having to define a custom |
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
var http = require('http'); | |
//Select the port on which to run this delayed request server: | |
var port = 8080; | |
//Select the maximum number of seconds to delay requests to this server: | |
var seconds = 1440; //Iknowright?!?! I needed a delay of up to 24 minutes! | |
//Gets random delay time in ms (maximum of var seconds): | |
var timeout = Math.floor((Math.random() * seconds) + 1) * 1000; | |
var server = http.createServer(function (req, res) { | |
//IMPORTANT! Override nodejs default 2 minute connection timeout - never timeout connections: |
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
delimiter // | |
DROP PROCEDURE IF EXISTS convert_database_to_utf8mb4 // | |
CREATE PROCEDURE convert_database_to_utf8mb4() | |
BEGIN | |
DECLARE table_name VARCHAR(255); | |
DECLARE done INT DEFAULT FALSE; | |
DECLARE cur CURSOR FOR |
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
/* | |
* Tested With: | |
* animate.css (v3.5.1): https://github.com/daneden/animate.css | |
* Bootstrap modal.js (v3.3.6): http://getbootstrap.com | |
* Usage: Be sure your modal div has class "animated" instead of "fade" | |
* and add the new data attributes for animate.css animation to use. | |
* Example: | |
* <div id="my-modal" class="modal animated" data-animate-css-show="fadeInRight" data-animate-css-hide="fadeOutLeft"> | |
* | |
* You can also use $(el).animateCss(class) to animate.css other stuff. |
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
/* Usage: $.selectorCache('#element') | |
* or to refresh cache: $.selectorCache('#element', true) | |
* | |
* Credit: https://ttmm.io/tech/selector-caching-jquery/ | |
*/ | |
(function($){ | |
var debug = false; | |
function SelectorCache() { | |
var collection = {}; |
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
mkdir TEMP_REPO_FOLDERNAME # create a new folder | |
cd TEMP_REPO_FOLDERNAME | |
git init --bare .git # create a bare repo | |
git remote add origin SOURCE_REMOTE_URL # add a remote | |
git fetch origin refs/heads/*:refs/heads/* # fetch heads | |
git fetch origin refs/tags/*:refs/tags/* # fetch tags | |
git init # reinit work tree | |
git checkout master # checkout a branch | |
git remote rm origin # remove remote repo url | |
git remote add origin NEW_REMOTE_URL # new remote url |