Web Apps
54.2K views | +0 today
 
Scooped by Srdjan Strbanovic
onto Web Apps
February 18, 2014 10:01 AM
Scoop.it!

Dug.js — A JSONP to HTML Script

Dug.js — A JSONP to HTML Script | Web Apps | Scoop.it
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:


dug({
endpoint: 'http://api.dribbble.com/players/justinmezzell/shots',
template: '{{#shots}}{{/shots}}'
});


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:


dug({
endpoint: 'http://api.dribbble.com/players/justinmezzell/shots',
template: '\
{{#shots}}\
\
\
\
\
\
{{/shots}}\
'
});


Here's an actual demo of the above code, running:

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.
No comment yet.
Web Apps
...JavaScript is awesome !
Your new post is loading...
Your new post is loading...
Scooped by Srdjan Strbanovic
July 25, 2013 5:07 PM
Scoop.it!

JointJS - JavaScript diagramming library.

JointJS - JavaScript diagramming library. | Web Apps | Scoop.it
Create interactive diagrams in JavaScript easily. JointJS plugins for ERD, Org chart, FSA, UML, PN, DEVS, LDM diagrams are ready to use.
No comment yet.
Rescooped by Srdjan Strbanovic from JavaScript for Line of Business Applications
October 18, 2015 12:42 PM
Scoop.it!

Unit testing React components without a DOM

Unit testing React components without a DOM | Web Apps | Scoop.it

When unit testing React components the common approach has been to render them into a DOM (with something like jsdom) and run some assertions against them with the help of the React TestUtils.

This has changed in 0.13 where an early implementation of shallow rendering is now ready to use.


Via Jan Hesse
No comment yet.
Scooped by Srdjan Strbanovic
December 20, 2014 10:40 AM
Scoop.it!

UX Project Checklist

UX Project Checklist | Web Apps | Scoop.it
Start your next UX project with this checklist and don't forget about anything!
No comment yet.
Scooped by Srdjan Strbanovic
December 14, 2014 11:06 AM
Scoop.it!

Functional Reactive React.js — Medium

Functional Reactive React.js — Medium | Web Apps | Scoop.it
A brief journey into reactive interfaces with FRP and React.js
No comment yet.
Scooped by Srdjan Strbanovic
December 8, 2014 10:12 AM
Scoop.it!

Don’t Build Pages, Build Modules — eBay Tech Blog

Don’t Build Pages, Build Modules — eBay Tech Blog | Web Apps | Scoop.it
Rethinking eBay’s frontend engineering and architecture stack
No comment yet.
Scooped by Srdjan Strbanovic
December 3, 2014 9:30 AM
Scoop.it!

12 HTML5 tricks for mobile | Web design | Creative Bloq

12 HTML5 tricks for mobile | Web design | Creative Bloq | Web Apps | Scoop.it
The mobile web is a strange world: dozens of browsers, versions, screen sizes, undocumented features, bugs and new problems. That is why, in some situations, we need to break some limits to accomplish our objectives. If you learn at least three new tricks while reading this article, my goal will be accomplished.
No comment yet.
Scooped by Srdjan Strbanovic
December 2, 2014 10:42 AM
Scoop.it!

Bacon.js blog: Structuring Real-Life Applications

No comment yet.
Scooped by Srdjan Strbanovic
November 28, 2014 9:01 AM
Scoop.it!

Introduction to IndexedDB: The In-Browser Database

Introduction to IndexedDB: The In-Browser Database | Web Apps | Scoop.it
Is dealing with databases on a browser your idea of a bad nightmare? Craig implements an in-browser document database called IndexedDB to create, read, ...
No comment yet.
Scooped by Srdjan Strbanovic
November 13, 2014 2:27 PM
Scoop.it!

interact.js - JavaScript drag and drop, resizing and gestures with inertia and snapping

interact.js - JavaScript drag and drop, resizing and gestures with inertia and snapping | Web Apps | Scoop.it
interact.js is a standalone javascript module for handling single-pointer and multi-touch drags and gestures with powerful options such as inertia and snapping to grids or custom coordintes
No comment yet.
Scooped by Srdjan Strbanovic
November 5, 2014 2:13 PM
Scoop.it!

STRUCTURE - A declarative grid framework

No comment yet.
Scooped by Srdjan Strbanovic
October 28, 2014 9:32 AM
Scoop.it!

Cardinal • Build more with less.

Cardinal is a small, “mobile first” CSS framework for front-end developers who build responsive web applications. It focuses on performance, accessibility, and readability first.
No comment yet.
Scooped by Srdjan Strbanovic
October 9, 2014 9:54 AM
Scoop.it!

How to Make a Sidescroller game with HTML5

How to Make a Sidescroller game with HTML5 | Web Apps | Scoop.it
Casual, simple 2D games can sometimes be more popular that overly complex million dollar productions. This is not either a good or a bad thing, it's just how pe
No comment yet.
Scooped by Srdjan Strbanovic
October 2, 2014 2:48 PM
Scoop.it!

Supercharge Your App Development with Ionic and AppBuilder -

Supercharge Your App Development with Ionic and AppBuilder - | Web Apps | Scoop.it
Ionic is slick. If you’re haven’t heard of it, Ionic is a UI framework that helps you build beautiful iOS and Android apps based on Cordova. Go ahead and peruse their UI components to see the powerful UIs you can build with a small amount of code. But although Ionic’s UI is top notch, the …
No comment yet.
Scooped by Srdjan Strbanovic
November 28, 2015 8:54 AM
Scoop.it!

Installable Web Apps May Be the Future of the Open Web

Installable Web Apps May Be the Future of the Open Web | Web Apps | Scoop.it
Installable web apps are apps that can be installed on phones or tablets outside of the device's app store. They also may be the future of the open web and apps in general.
No comment yet.
Scooped by Srdjan Strbanovic
January 3, 2015 11:17 AM
Scoop.it!

Scaling Isomorphic Javascript Code | Nodejitsu Inc.

Scaling Isomorphic Javascript Code | Nodejitsu Inc. | Web Apps | Scoop.it
Nodejitsu blog provides high quality articles about Node.JS, javascript and npm
No comment yet.
Scooped by Srdjan Strbanovic
December 18, 2014 4:14 PM
Scoop.it!

Articles – Sara Soueidan – Freelance Front-end Web Developer

Articles – Sara Soueidan – Freelance Front-end Web Developer | Web Apps | Scoop.it
Freelance Front-End Web Developer - Lebanon
No comment yet.
Scooped by Srdjan Strbanovic
December 9, 2014 8:48 AM
Scoop.it!

How to build a React JS test suite

Learn how to setup a test suite for React JS with Jest and Webpack....
No comment yet.
Scooped by Srdjan Strbanovic
December 8, 2014 8:51 AM
Scoop.it!

How to Test Browsers on Virtual Machines from Modern.IE

How to Test Browsers on Virtual Machines from Modern.IE | Web Apps | Scoop.it
Testing multiple versions of Internet Explorer is possible from any OS including Mac and Linux using free VMs from modern.ie.
No comment yet.
Scooped by Srdjan Strbanovic
December 2, 2014 4:34 PM
Scoop.it!

Introduction to Service Worker: How to use Service Worker - HTML5 Rocks

Introduction to Service Worker: How to use Service Worker - HTML5 Rocks | Web Apps | Scoop.it
Service Worker will revolutionize the way we build for the web. Learn about what it is, why it is important and how to use it.
No comment yet.
Scooped by Srdjan Strbanovic
November 28, 2014 9:04 AM
Scoop.it!

Tips for authoring fast-loading HTML pages

Tips for authoring fast-loading HTML pages | Web Apps | Scoop.it
These tips are based upon common knowledge and experimentation.
No comment yet.
Scooped by Srdjan Strbanovic
November 10, 2014 2:15 PM
Scoop.it!

Webinar Archive – Designing Front End Applications with Core.async

Webinar Archive – Designing Front End Applications with Core.async | Web Apps | Scoop.it
No comment yet.
Scooped by Srdjan Strbanovic
October 28, 2014 9:47 AM
Scoop.it!

The Anti-hero of CSS Layout -

The Anti-hero of CSS Layout - | Web Apps | Scoop.it
Anti-hero - a central character in a story, movie, or drama who lacks conventional heroic…
No comment yet.
Scooped by Srdjan Strbanovic
October 14, 2014 12:40 PM
Scoop.it!

Getting Started with SASS (with interactive examples)

Getting Started with SASS (with interactive examples) | Web Apps | Scoop.it
No comment yet.
Scooped by Srdjan Strbanovic
October 3, 2014 1:33 PM
Scoop.it!

hello.js - Javascript OAuth and REST library

A client-side Javascript SDK for authenticating with OAuth2 (and OAuth1 with a oauth proxy) web services and querying their REST API's. HelloJS standardizes paths and responses to common API's like Google Data Services, Facebook Graph and Windows Live Connect. It's modular, so that list is growing. No more spaghetti code!
No comment yet.
Scooped by Srdjan Strbanovic
September 29, 2014 12:16 PM
Scoop.it!

Building OS X Apps with JavaScript by Tyler Gaw

Building OS X Apps with JavaScript by Tyler Gaw | Web Apps | Scoop.it
Tyler Gaw is a Freelance Web Designer & Developer in Brooklyn, New York
No comment yet.