Skip to content

Instantly share code, notes, and snippets.

K Adam White kadamwhite

Block or report user

Report or block kadamwhite

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
@kadamwhite
kadamwhite / tracking.js
Created Apr 23, 2012
A more flexible SiteCatalyst link tracking script wrapper
View tracking.js
// Wrapper function for native Omniture SiteCatalyst link tracking (s.tl())
var trackLink = function (referenceObject, trackingData, targetReportSuite) {
if (typeof referenceObject === 'undefined' || typeof trackingData === 'undefined') {
// If you're missing your settings object or any variables/events to fire, you fail
return;
}
var linkTrackVarsArray = [],
// Get values out of the configuration object
tEvents = trackingData.events, // String || undefined
tVars = trackingData.variables, // Object || undefined
@kadamwhite
kadamwhite / wcbos-preprocessors-outline.md
Created Jul 12, 2012
CSS Pre-Processors Slide Outline for WordCamp Boston 2012
View wcbos-preprocessors-outline.md
@kadamwhite
kadamwhite / invader.css
Created Sep 5, 2012
Pure-CSS Space Invader
View invader.css
/**
* Pure-CSS Space Invader, adapted to a 2px pixel size from
* the original example at CSS-Tricks "The Shapes of CSS"
*
* @link: http://css-tricks.com/examples/ShapesOfCSS/
*/
.invader {
box-shadow:
-4px -2px white, 4px -2px white,
@kadamwhite
kadamwhite / main.js
Created Dec 13, 2012
A basic JW Player plugin to display a text banner overlay at the top of the video player instance
View main.js
// Pass the plugin reference and configuration parameter ('text') to the embed script
jwplayer('id-of-container').setup({
file: '/path/to/my/video.mp4',
plugins: {
'/path/to/overlay.js': {
text: 'Text that you want to go within the overlayed banner'
}
}
});
@kadamwhite
kadamwhite / bandify.js
Created Jan 31, 2013
Based on https://twitter.com/the55/status/295991439484137472, this is (will be) a script to fetch text nodes from the current page, pick a few random phrases, and combine them into an entertaining song name with band, track, and optionally remixer/remix name.
View bandify.js
function findTextNodes( node ) {
var text = [];
if ( node.nodeType === 3 ) {
text.push( node.nodeValue );
// TODO: Filter out carriage returns, whitespace.
// POSSIBLE TODO: Restrict to nodes within the main content area of the page? (so don't get ads, etc)
} else {
for ( var i = 0, max = node.childNodes.length; i < max; i++ ) {
text = text.concat( findTextNodes( node.childNodes[i] ) );
}
@kadamwhite
kadamwhite / blokkit.js
Last active Jun 19, 2017
Bookmarklet to convert all text on a webpage to the Blokk font, for use when working on mockups in your browser.
View blokkit.js
(function() {
var css = "*{font-family:\"Blokk Regular\", blokk !important;}",
head = document.getElementsByTagName("head")[0],
style = document.createElement("style");
style.type = "text/css";
if ( style.styleSheet ) {
style.styleSheet.cssText = css;
} else {
style.appendChild( document.createTextNode( css ) );
}
@kadamwhite
kadamwhite / Modules.txt
Created Feb 28, 2013
Modules defined within Tweetdeck's main script file, with dependencies
View Modules.txt
"flight/utils", []
"flight/compose", []
"flight/advice", ["./utils", "./compose"]
"flight/registry", ["./utils"]
"flight/component", ["./advice", "./utils", "./compose", "./registry"]
"data/with_client", []
"data/accounts", ["flight/component", "data/with_client"]
"data/column_manager", ["flight/component"]
"data/embed_tweet", ["flight/component", "data/with_client"]
"util/with_version_comparator", []
@kadamwhite
kadamwhite / multi-line-EVERYTHINGGGG.js
Created May 22, 2013
AngularJS Declaration Conventions
View multi-line-EVERYTHINGGGG.js
module.directive('myDirective', [
'$compile',
'$location',
'Notify',
'sharedData',
function(
$compile,
$location,
Notify,
sharedData
View ginblossom.md

Gin Blossoms

If you thought Smash Mouth has a strong drink connotation, this band's just cheating: There's a delicious drink just sitting there waiting for you, called, appropriately, the

Gin Blossom

BUT there is some contention about what that is. The one I know is apparently

The Clover Club version

@kadamwhite
kadamwhite / thoughts.md
Last active Dec 27, 2015
Towards Consistent JavaScript Code Style in WordPress
View thoughts.md

JavaScript Coding Standards

The core WordPress PHP files become cleaner and easier to read with every release, thanks in part to our strong standards for PHP code style. Our JavaScript, on the other hand, hasn't gotten nearly enough love. This post is intended to open up the recent discussion around JavaScript style to the greater community so we can make up for lost time.

Don't we already have a style guide for JavaScript?

Back in March, @tommcfarlin added a set of coding standards for JavaScript to the developer handbook. These WordPress JS coding standards were a great work-in-progress, but weren't fully comprehensive (leading to some comment threads clarifying various areas). More importantly, without any clear implementation plan the style guide failed to gain traction.

At WordCamp Boston's core

You can’t perform that action at this time.