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 / drupal_parallel_drush.sh
Created May 12, 2017 19:35
Bash Script for running multisite drush in parallel
#!/bin/bash
DRUPALPATH=$1
shift
if [ "$DRUPALPATH" == "" ]
then
echo "Usage: $0 drupal-path drush-command with-args?"
exit 1
fi
@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 / 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();
@dasginganinja
dasginganinja / drush-drupal-7-grant-all-privileges-to-role.php
Last active March 7, 2018 11:03
Drupal 7 Drush Command to Grant All Permission to A Role
<?php
// Get the Role ID we want to add all permissions to
$rid = user_role_load_by_name('Super Administrator')->rid;
// Get a listing of all of the permissions
$perms = array_keys(user_permission_get_modules());
// Grant permissions for the role
user_role_grant_permissions($rid, $perms);
@dasginganinja
dasginganinja / sis_site.install.php
Last active November 4, 2015 21:14
Drupal 7 Enable theme in hook_install
<?php
/**
* Implements hook_install().
*/
function sis_site_install() {
// Do some things on install, like setting the module weight.
// Setup the Adminimal theme
$themes = list_themes();