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 / gallery-export.sql
Last active August 29, 2015 14:28
ShepNet Gallery Export (all images on one line for import into D7)
@dasginganinja
dasginganinja / Shipping Rate - PA Tax Component Rules
Last active August 29, 2015 14:28
Drupal Commerce Sales Tax for Taxable Items & Shipping
{ "commerce_tax_rate_pa_sales_tax" : {
"LABEL" : "Calculate PA Sales Tax",
"PLUGIN" : "rule",
"OWNER" : "rules",
"TAGS" : [ "Commerce Tax", "sales_tax" ],
"REQUIRES" : [ "commerce_order", "rules", "commerce_tax" ],
"USES VARIABLES" : { "commerce_line_item" : { "label" : "Line item", "type" : "commerce_line_item" } },
"IF" : [
{ "commerce_order_compare_address" : {
"commerce_order" : [ "commerce-line-item:order" ],
@dasginganinja
dasginganinja / check-status.sh
Created October 29, 2015 16:27
HTTP Status checking
# Check for number of urls with 200 statuses
grep 200 out.txt | wc -l
@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();
@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 / 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 / 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 / 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 / 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 / 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>