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
@doublejosh
doublejosh / sequential-load.js
Last active August 29, 2015 14:22
Sequentially load files
var loadedPromise,
paths = [
'//code.jquery.com/jquery-1.11.3.min.js',
'//cdnjs.cloudflare.com/ajax/libs/jStorage/0.4.12/jstorage.min.js'
];
function simpleInclude(path) {
return new Promise(function (resolve, reject) {
var script = document.createElement('script');
script.src = path;
@doublejosh
doublejosh / demand_base_tracking.php
Last active August 29, 2015 14:24
Include tracking Script in a nice configurable way
<?php
/**
* ADMIN...
*/
// Render tracking script setting area.
$form['demandbase_tracking'] = array(
'#type' => 'fieldset',
'#title' => t('Tracking'),
@doublejosh
doublejosh / copyLabels.coffee
Last active June 16, 2017 23:04
Copy labels
~/Documents/clones/assembla2github
coffee ./assembla2github.coffee copyLabels -s tableau-mkt/www7 -d "tableau-mkt/groucho"
@doublejosh
doublejosh / remove-git-folders.sh
Created September 3, 2015 21:24
Remove .git folders in folders within current
(find . -type d -name ".git") | xargs rm -rf
@doublejosh
doublejosh / ultralite-router.js
Last active September 7, 2015 09:56
Simple JS application router
/**
* Application URL router.
*/
define(function (require) {
function Router() {
this.parser = {};
this.routes = [];
@doublejosh
doublejosh / entity_form_nonsense.php
Created September 15, 2015 03:52
Entity form rabbit hole dead end
<?php
// Add entity data item for component and modifier.
function componentize_fields_entity_info_alter(&$entity_info) {
dsm($entity_info);
}
/**
* Implements hook_form_alter().
@doublejosh
doublejosh / tableau_recommended.js
Created October 6, 2015 16:09
Backup of recommender switcher
@doublejosh
doublejosh / node_bundle_extra_field.php
Created October 13, 2015 19:02
Bundle extra field
<?php
// tableau_sitewide_tweaks.install
/**
* Utility function to hide ANY newly created extra_fields.
*
* @param $entity_type string
* @param $bundle string
* @param $field_name string
*/
@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
@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