Skip to content

Instantly share code, notes, and snippets.

Adam Made-of-Clay

  • Ohio
Block or report user

Report or block Made-of-Clay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Made-of-Clay
Made-of-Clay / array_combine.js
Created Dec 19, 2017
Recreating PHP's array_combine function; generates a map/object literal from two arrays
View array_combine.js
/**
* This function mimics PHP's array_combine function
* @param {array} keys Array to be used as new object's keys
* @param {array} values Array to be mapped to respective keys
* @example
* array_combine(['Rick', 'Morty'], ['Sanchez', 'Smith']); // returns { Rick:'Smith', Morty:'Smith' }
*/
function array_combine(keys, values) {
let obj = {};
keys.forEach((k, i) => obj[k] = values[i]);
@Made-of-Clay
Made-of-Clay / pubsub-simple.js
Last active Jul 12, 2017 — forked from fatihacet/pubsub-simple.js
Simple PubSub implementation with JavaScript - taken from Addy Osmani's design patterns book & ESM-ified
View pubsub-simple.js
let topics = {}, subUid = -1;
// https://gist.github.com/fatihacet/1290216
export default {
subscribe(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
let token = (++subUid).toString();
topics[topic].push({
token,
@Made-of-Clay
Made-of-Clay / datatables-1.10-param-convert-map.json
Last active Oct 18, 2016
Datatables parameter conversion map for converting Hungarian (1.9-) to camelCase (1.10+)
View datatables-1.10-param-convert-map.json
{
"__note": "keys with value of 'null' have been removed",
"aaData" : "data",
"aaSorting" : "order",
"aaSortingFixed" : "orderFixed",
"aDataSort" : "columns.orderData",
"aLengthMenu" : "lengthMenu",
"aTargets" : "columnDefs.targets",
"aoColumns" : "columns",
"aoColumnDefs" : "columnDefs",
@Made-of-Clay
Made-of-Clay / Draggable.js
Created Dec 9, 2015 — forked from Rob-ot/Draggable.js
Draggable and dropable views for backbone, uses html5 drag and drop api, requires jquery and underscore, not tested in IE yet
View Draggable.js
return View.extend({
initialize: function () {
this.el.attr("draggable", "true")
this.el.bind("dragstart", _.bind(this._dragStartEvent, this))
},
_dragStartEvent: function (e) {
var data
if (e.originalEvent) e = e.originalEvent
e.dataTransfer.effectAllowed = "copy" // default to copy
View Minit_issue_markup
/*----- Before Minit -----*/
/* line 12, sassy_s/_theme.scss */
body {
background: url("http://domain.com/_subdir_/wp-content/themes/_themename_/images/header_graphic_fin.png") repeat-x transparent;
}
/*------ After Minit -----*/
/* line 12, sassy_s/_theme.scss */
body {
background: url('http://domain.com/_subdir_/wp-content/themes/_themename_//_subdir_/wp-content/themes/_themename_/images/header_graphic_fin.png') repeat-x transparent;
You can’t perform that action at this time.