It seemed like we were constantly making custom social sharing buttons for every single project, so we decided to create a super flexible system that would work in any container. SASS-powered, retina ready, and auto-magical resizing. A KNI Labs freebie.
We use HTML to tell stories and communicate vast amounts of information—and animation helps us do both better. Just as hierarchy guides users through content, animation guides them through interactions by helping them understand relationships, structure, cause, and effect. Rachel Nabors explains her fascination with CSS3 animations, Canvas, SVG, the web audio API, webGL, and all the rest, and explains why we need web animation—and web animators.
So you want to display your Dribbble shots, recent pins on Pinterest, 500px or Instagram photos, Github commits, or recently listened to music on your blog or site? Then this chunk of javascript is for you. It was designed to be a lightweight, simple, library-independent script to pull in feeds of content available on the web as JSONP (there's lots of em!) to display on your site.
I wrote this script because I wanted a dead-simple way to show my dribbble shots on my site. I wanted to be able to customize the markup with a custom template and have the content client side cache. I wanted to do the same with Pinterest inspiration that I was finding for illustrations that I love. Instead of having dedicated scripts for every service, why not just have one very small raw script (~200 lines) to do it all?
Dug.js Setup
Enough windbaggery, let me show you how to use it. Because Dug.js is on my site, I can run the code in this blog post. Let's talk about that Dribbble implementation first. So, I want to pull in my latest Dribbble shots. Scanning the Dribbble api, I see that they do support JSONP and that you can pull in all player shots with the following url: http://api.dribbble.com/players/:id/shots
Rad! With Dug.js, we're nearly there. In it's simplest form, you really only need two things.
1. An api endpoint (jsonp callbacks supported) 2. An HTML template to display the data
With that in mind, let's setup dug.js to pull dribbble shots from an awesome illustrator's account:
If you're familiar with mustache or similar templating, the {{#shots}}...{{/shots}} section apply the html within it over every shot, in this case, emitting an image for each shot. Hint: you can also supply a CSS selector to target a template script, and Dug.js will pull the content from it.
That's a pretty simple example, but what if you want each shot linking to it's detail page? Here ya go:
That's it! Pretty simple huh? Yeah, thats why I dig it too!
Dug.js Parameters
For those that are curious, here's a few parameters (as json name-value pairs) that you can pass into dug to do some additional schnazzy things:
* target — the id of an existing DOM element to put the html results in. * cacheExpire — # of milliseconds to cache data on the client side (using localstorage). 0 for no caching. * callbackParam — the name of the query variable a JSONP service will use for a callback function. Most services just use 'callback=functionName', but sometimes a service will use a different query variable name. * success — a function to call when JSONP data is successfully retrieved. * error — a function to call when JSONP data is not successfully retrieved. * beforeRender @param data — a function called before Dug.js renders the template. Helpful for trimming/changing the data before it renders. * afterRender @param data — a function called after Dug.js renders the template. Download Dug.js
Dug.js is completely free! Although, if you're diggin' this script hard and want to help fund my graphic tablet purchase (for art like Dug the dog above. Yay!), feel free to donate.
Dug.js is for everyone!
Name your price! Any donations go toward funding my graphic tablet purchase (for making more art like Dug). It also allows me to drink coffee or microbrews so I can have the sanity to support Dug.js, but, if you're low on the dough, enter a zero and off you go!
Download
Download Dug.js
License
Dug.js is 100% free under the WTFPL — no link backs or anything needed.
I start looking at Durandal after attending Jason Clark’s DurandalJS and Twitter Bootstrap at Nashville .NET User Group. Durandal is a SPA framework that incorporated several popular JavaScript lib...
I’ve been using Promises in my JavaScript code for a while now. They can be a little brain bending at first. I now use them pretty effectively, but when it came down to it, I didn’t fully understand how they work. This article is my resolution to that. If you stick around until the end, you should understand Promises well too.
We will be incrementally creating a Promise implementation that by the end will mostly meet the Promise/A+ spec, and understand how promises meet the needs of asynchronous programming along the way. This article assumes you already have some familiarity with Promises. If you don’t, promisejs.org is a good site to checkout.
Why bother to understand Promises to this level of detail? Really understanding how something works can increase your ability to take advantage of it, and debug it more successfully when things go wrong. I was inspired to write this article when a coworker and I got stumped on a tricky Promise scenario. Had I known then what I know now, we wouldn’t have gotten stumped.
In this comprehensive primer, you will learn what happens in the browser between when you type google.com in the address bar until you see the Google page on the browser screen.
Like Lorem Ipsum, but for people. RandomUser is an API that provides you with a randomly generated user. These users can be used as placeholders in web mockups, and will save you time from creating your own placeholder information.
Placeholdem is a JavaScript plugin that animates placeholder carets on inputs and textareas. The placeholder value will incrementally delete on focus, and restore on blur.
When building a web page composed of different parts, the different parts can be combined at different stages of page rendering. Everything can either be loaded…
In this third part of our Chrome Developer Tools series, we'll review how to modify and debug JavaScript. Optimization is an important part of the development process, especially for performance-critical applications. We'll also discuss techniques for identifying potential bottlenecks in our code. | Difficulty: Beginner; Length: Medium; Tags: Tools & Tips, Web Dev, Chrome Dev-Tools
To get content containing either thought or leadership enter:
To get content containing both thought and leadership enter:
To get content containing the expression thought leadership enter:
You can enter several keywords and you can refine them whenever you want. Our suggestion engine uses more signals but entering a few keywords here will rapidly give you great content to curate.