Skip to content

Instantly share code, notes, and snippets.

View dasginganinja's full-sized avatar

Tom Donahue dasginganinja

  • Lehigh University
  • Bethlehem, PA
View GitHub Profile
@dasginganinja
dasginganinja / findMixedModeErrors.js
Created September 28, 2017 11:37
Find mixed mode issues in content. The src attribute matches scripts, images, iframes. The link href attribute is used for css.
jQuery(document).ready(function() {
var $srcitems = jQuery("[src^='http://']");
var $hrefitems = jQuery("link[href^='http://']");
var totalitems = $srcitems.length + $hrefitems.length;
if (totalitems > 0) {
alert('Found ' + totalitems + ' items that will trigger mixed mode. Check the console for these items.');
for (var i = 0, len = $srcitems.length; i < len; i++) {
console.log($srcitems[i]);
}
for (var i = 0, len = $hrefitems.length; i < len; i++) {
@dasginganinja
dasginganinja / drupal_diff_module.sh
Created June 5, 2017 15:38
Bash Script for easily seeing differences between module versions
#!/bin/bash
MODULE=$1
VERFROM=$2
VERTO=$3
shift
shift
shift
if [ "$MODULE" == "" ] || [ "$VERFROM" == "" ] || [ "$VERTO" == "" ]
@dasginganinja
dasginganinja / objects.post.php
Created April 21, 2017 22:30
CS-Cart Custom URL route for frontend controller mode. For CS-Cart 4.4.x.
$schema = array(
'/rep-lookup' => array(
'dispatch' => 'rep_lookup.search'
)
);
return $schema;
@dasginganinja
dasginganinja / view.export
Created December 28, 2016 15:46
Drupal 7 Views - Paragraphs Bundle Breakdown
$view = new view();
$view->name = 'bundles_usage';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'paragraphs_item';
$view->human_name = 'Bundles usage';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@dasginganinja
dasginganinja / page.tpl.php
Created December 8, 2016 19:05
Drupal 7 Search Block Form - Custom Markup
<div class="searchWrapper">
<div class="searchContainer">
<?php print $search_box; ?>
</div>
</div>
@dasginganinja
dasginganinja / pokemans
Created July 28, 2016 03:38
pokemon locations
https://pokevision.com/#/@40.58047058555029,-75.58394193649292
Chapmans Rd near Blue Barn -- https://pokevision.com/#/@40.60922852398531,-75.58470368385315
tentacool - https://pokevision.com/#/@40.60656913748868,-75.58687090873718
vulpix / drowzee - https://pokevision.com/#/@40.583827673731975,-75.59106588363647
goldduck - https://pokevision.com/#/@40.594455983617884,-75.50577163696289
@dasginganinja
dasginganinja / disable.pokevision.timeout.js
Last active July 26, 2016 12:01
Pokevision 30s disabler
// Run this in your javascript console
App.home.TIMER_ERROR = App.home.TIMER_JOB = App.home.TIMER_SCAN_DELAY = App.home.TIMER_SCAN_ERROR = App.home.TIMER_TIMER_UPDATE = 1000;
@dasginganinja
dasginganinja / sh_drupal_language.php
Last active May 10, 2016 11:30
Drupal Bulk Language Changer (Uses Views Bulk Options)
$view = new view();
$view->name = 'sh_drupal_languages';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'sh_drupal_languages';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@dasginganinja
dasginganinja / drupal-bootstrap-fix.scss
Created March 16, 2016 16:51
SASS for bootstrap form elements in Drupal by extending bootstrap
.form-item {
@extend .form-group;
select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
@dasginganinja
dasginganinja / fix-admin-menu.php
Created February 10, 2016 14:19
Admin Menu Full Rebuild Fix
<?php
db_query("DELETE FROM {menu_links} WHERE module = 'system'");
db_query("DELETE FROM {menu_links} WHERE menu_name = 'management'");
menu_rebuild();