Skip to content

Instantly share code, notes, and snippets.

View doublejosh's full-sized avatar
🎰
front-ending

Josh Lind doublejosh

🎰
front-ending
View GitHub Profile
/**
* Template for adding plenty of easy logging to your code.
*/
var severityLevel = configs.severity || 1,
log = {};
// Quick messages, not intended to post unless debugging is needed.
log.debug = function (message, data) {
log.post(0, message, data);
/**
* Example of Behave JS with public and private functions,
* using flexible private function to process results. Shown
* here firing on page load and AJAX submits.
*/
(function ($) {
// Note {only: false} allows AJAX context rather than ready.
var behave = Drupal.behave('myBehavior', {only: false}),
behavior = behave.behavior();
@doublejosh
doublejosh / Tabia_module.js
Last active June 16, 2016 18:54
Drupal behavior without indents template
// Ensure and setup namespace.
var Tabia = window.Tabia || {};
(function ($, module) {
// Add utility functions.
module.myFunction = function () {
console.log('Separate files are nice');
};
@doublejosh
doublejosh / button_sheen.js
Last active February 12, 2016 10:54
Button Sheen
/**
* Set CTA button image background and indicator class.
*/
(function ($) {
var sheenUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALcAAAC3CAMAAABnsD+tAAACZFBMVEVMaXH////////////////29vb////////////////////////////////////////////////////////////////////////////////////////////39/ft7e3////d3d3///9wcHD////w8PD////39/f39/dpaWnU1NTk5ORXV1fMzMz29va0tLS9vb329vbw8PB7e3teXl6fn5+Dg4Pp6emXl5dGRkasrKx4eHju7u5QUFDl5eXo6Ojp6elhYWGPj4/Dw8Pi4uKLi4vv7+/FxcVNTU2np6fh4eHv7+/a2trh4eE/Pz8+Pj7u7u7V1dXOzs5mZmZ/f3/b29vc3NzU1NTm5ubZ2dn////n5+fe3t7Nzc3Hx8ekpKTj4+PV1dWSkpKOjo7T09NLS0vKyspERETAwMDS0tLn5+eHh4d0dHRzc3PNzc2dnZ2WlpZtbW27u7tSUlKsrKzMzMxZWVm3t7fDw8OKiop7e3vf39/Gxsanp6e2trbPz8+vr6+0tLTExMTX19elpaW/v79VVVW9vb1jY2Ozs7Pg4OBcXFy6urqDg4NxcXHQ0NCRkZFnZ2eampqioqLBwcG/v79ubm6goKB/f39gYGDY2NilpaWZmZmurq6srKzHx8eQkJB1dXW5ubmqqqpqamqGhoaCgoKxsbF8fHyxsbGUlJS4uLjIyMiqqqqJiYmNjY2bm5uioqJ4eHienp6Xl5e1tbW7u7vw8PCnp6eurq739/ehoaGHh4eMjIyGhoaamprCwsJycnJ4eHjJyclkZGQ3NzeTk5N/f39ra2tISEhdXV3q6ur19fWRWRJRAAAAzHRSTlMAEwoSAx0EAR0CBh4
@doublejosh
doublejosh / _tableau_dev_on_admin.php
Created January 29, 2016 23:37
_tableau_dev_on_admin()
<?php
/**
* Determine if user is a dev on an admin page.
*/
function _tableau_dev_on_admin() {
if (user_has_role(3) && path_is_admin(current_path())) {
return TRUE;
}
return FALSE;
@doublejosh
doublejosh / favorite_work_skills.yaml
Created January 4, 2016 20:03
Tableau Labels-based Issue Preferences
---
layout-large: Desktop
layout-medium: Tablet
layout-small: Mobile Layout
skill-front: Front-end
tag-IE: Internet Explorer
tag-mobile: Mobile
skill-back: Back-end
skill-ops: Operations
tag-localize: Localize
@doublejosh
doublejosh / favorite_work-josh.yaml
Created January 4, 2016 19:38
Tableau Labels-based Issue Preference Profile - Josh
---
name: Josh Lind
email: jlind@tableau.com
# Favorite stuff to do...
favSkills:
- layout-large
- skill-front
- tag-mobile
- skill-back
- cust-mktg-leadGen
@doublejosh
doublejosh / favorite_work.yaml
Last active January 4, 2016 19:43
Tableau Labels-based Issue Preference Profile
---
name: Ms. Awesome
email: awesome@example.com
# Favorite stuff to do...
favSkills:
# Front-end
- layout-large
- layout-medium
- layout-small
- skill-front
@doublejosh
doublejosh / webinar.sql
Last active December 17, 2015 21:13
Get webinar URLs
SELECT n.nid as 'node-id', n.tnid as 'translation-nid', n.title, n.language, d.field_on_demand_value as 'ondemand', u.alias AS url
FROM node as n
LEFT JOIN url_alias as u
ON u.source = CONCAT('node/', n.nid)
LEFT JOIN field_data_field_on_demand as d
ON d.entity_id = n.nid
WHERE n.type = 'webinar'
ORDER BY nid
@doublejosh
doublejosh / adjust_filename.sh
Created December 8, 2015 22:46
Remove "-icon" from filenames
for i in ./*-icon*;do mv -- "$i" "${i//-icon/}";done