Profile

Cover photo
Dan Kapusta
132 followers|9,019 views
AboutPostsPhotos+1's

Stream

Dan Kapusta

Shared publicly  - 
 
This is pretty rad.
 
Just Go Be Awesome

That's all. No time to waste today people. Go!  #DailyKickInThePants  

#cinemagraph   #creativity   #inspiration  
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
Often the HN thread of comments is as informative at the article it discusses. This is one of those threads.
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
This is making me itchy.
 
Remember the robot spiders from "Runaway" w/ Tom Selleck? They're pretty much totally real now:

PhantomX terrain walking
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
Jetpacks are rad.
 
The practicality of jetpacks explored. I still want one though, don't you?
1
Add a comment...
In his circles
257 people
Have him in circles
132 people
Frank Caruso's profile photo
Michael Harrison's profile photo
Michael Pachter's profile photo
Vincent Iademarco's profile photo
Evan Moseman's profile photo

Dan Kapusta

Shared publicly  - 
 
Let's see some hot browser on REST api action.
 
Consuming REST APIs with Restangular / AngularJS binding with Realtime APIs
Most apps need to communicate with servers to store and share data, and many of those apps do so through Restful APIs or realtime data services. In this month's meetup, our two speakers are going to show us two powerful tools to facilitate this communication. Martin Gontovnikas, author of Restangular, will demonstrate how the Restangular service provides easy, boilerplate-free REST API interaction. Jeff Cross from the Angular team will be presenting on a new module to facilitate realtime binding of Angular models with various Realtime APIs.

6-6.30p PT: Consuming REST APIs with Restangular (Martin Gontovnikas) 
6.30-7p PT: AngularJS binding with Realtime APIs (Jeff Cross of the AngularJS team) 
7p - Q&A

Join us in person (RSVP starting 9/3 at http://www.meetup.com/AngularJS-MTV/events/136001952/, doors open at 5:30p PT).
YouTube Livestream from the AngularJS-MTV Meetup
Tue, September 17, 2013, 9:00 PM

1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
The numbers in this one seem like the decimal was misplaced.
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
I'm a day late, but Happy Birthday to the Web and many thanks to TBL.
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
trying to find a little peace of mind
in melodies and memory
from the fear and attraction
of a fickle love.

in the reflection of a memory
you were 17, i was 23
we gave up our tears
to a neon sky.
1
Add a comment...

Dan Kapusta

Shared publicly  - 
 
Had a highly unusual day today...

Had a proper english breakfast, visited Apple and then visited the Goog and saw +vint cerf (omg) then visited the HP Garage and was spontaneously photographed for an article in Le Monde (I guess?) and had an english inspired dinner with spotted dick for dessert. Now watching the opening ceremonies. #amazingday  
2
Add a comment...

Dan Kapusta

Shared publicly  - 
 
 
I've been working hard on getting JS Bin v3 ready for release, but one of the final issues was to do with the history API not being supported in IE8-9 (yes, JS Bin supports those browser - that's for another day).

# Here's the situation:

JS Bin makes use of pushState. When you start typing in an empty bin, a new bin is automatically created for you and you now have a dedicated url. Something like http://jsbin.com/abcd/1/ (the code is abcd, and revision 1).

When the Ajax response comes back saying the initial creation was successful, we pushState the new url and you carry on typing (whilst JS Bin continues to save in the background).

This kinda worked in oldIE already, I would detect pushState support and the browser would reload. At this point you'd have the good url.  The crap experience part is reloading whilst you're actually typing. Not acceptable.

I could consider using History.js, but the issue is sharing URLs, loading JS Bin in the right state (since the data is driven by what URL you've visited). 

My biggest issue was what if an IE user shared their URL on twitter. If I opened that shared link in Chrome - what would happen?

# The solution:

The solution may look a bit funky, but it kinda works quite well.  Simply, instead of doing the refresh in my code (where the user would type and the page would refresh with the updated url), it now just tacks on the new url on the `location.hash`.  

In a fresh JS Bin window, that url will look like this: http://jsbin.com/#/abcd/1/edit

However, if I was already on the url http://jsbin.com/abcd/1/edit (note we don't have a hash there), the url will become:

http://jsbin.com/abcd/1/edit#/abcd/2/edit

Yep - that's ugly, BUT, ugly is fine if it works. All the share urls contain the correct (non-hash url), so it's only if the user shares this ugly URL do I need to worry.  

So, as the very first thing in my code, I have a check that says:

Does this URL have a hash, and does that hash look like /<code>/<rev>/edit? If it does, simply redirect the browser (using JavaScript) to that location.

# Conclusion

It's not pretty, but it's 2 extra lines to all of JS Bin (which is pretty honking already) and it all just works, which is kinda nice.

I've included a link to the commit I made so you can see the code change if you're interested.
1
Add a comment...
People
In his circles
257 people
Have him in circles
132 people
Frank Caruso's profile photo
Michael Harrison's profile photo
Michael Pachter's profile photo
Vincent Iademarco's profile photo
Evan Moseman's profile photo
Work
Occupation
UI Engineer
Story
Tagline
A software engineer with an English degree.
Introduction
I'm a UI Engineer who's trying to keep things simple.
Bragging rights
I own a sealed 50 user license of Netscape Navigator 1.1
Basic Information
Gender
Male
Looking for
Friends, Networking
Relationship
Married
Other names
Daniel Kapusta
Dan Kapusta's +1's are the things they like, agree with, or want to recommend.
The Humble Indie Bundle #4 (pay what you want and help charity)
www.humblebundle.com

Pay what you want for a collection of awesome games, and help support two charities. All of the games are DRM-free and support Mac, Windows,

TechCrunch
plus.google.com

Breaking technology news and analysis: the web, mobile, and much more.

Silicon Valley Salaries: What Can You Expect to Earn in the Valley?
www.focus.com

The Valley's tech job market: There are currently around 48,000 jobs at internet companies in the Valley - more than the

VMware's slow and steady attack on storage
gigaom.com

VMware has transformed the enterprise computing model more than any other company in the past decade. Now, with the latest release of vSpher

Facebook Messenger, Google+ Huddle and iMessage compared
gigaom.com

Now that Facebook has thrown its hat in the ring, there are quite a few choices for mobile messaging on the iPhone and other iOS devices. Th

seldo: Microsoft UI has officially entered the... — 9-Bits by David ...
9-bits.com

seldo: “ Microsoft UI has officially entered the realm of self-parody. ” I think I’d find another occupation if I had to work on Windows. Ed

TrackMania 2: Canyon Review - Giant Bomb
www.giantbomb.com

The long-awaited full sequel to TrackMania is here! Drive fast and drift long in this crazy, physics-based fun racing game.

Age of Empires Online (video game)
www.giantbomb.com

One of the best-selling real-time strategy series of all time returns with Age of Empires Online.

A Guy, A Crate and Seven Days of Lord of the Rings Online - Giant Bomb
www.giantbomb.com

Jordan Long&#39;s going inside a box and travelling across the country. For art.

Hard Reset (video game)
www.giantbomb.com

Hard Reset is the debut game from a new polish development studio, Flying Wild Hog. It will be exclusive for the PC.

Nintendo Slashes 3DS Price to $169.99, Early Adopters Get Free Games - G...
www.giantbomb.com

The house that Mario built seems to have taken disappointing hardware sales to heart.

The Kid Who Created Team Fortress 2&#39;s Controversial Anti-Free-to ...
www.giantbomb.com

Asher Baker created the mod getting headlines, but he&#39;s not even against free-to-play.

YouTube - Gamescom Coverage : Hyper WTF is Firefall? (Part 1)
www.youtube.com

Create AccountSign In. Home. BrowseMoviesUpload. Hey there, this is not a commercial interruption. You&#39;re using an outdated browser, whi

Newegg.com - G.SKILL Ripjaws Series 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR...
www.newegg.com

Buy G.SKILL Ripjaws Series 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Desktop Memory Model F3-12800CL9D-8GBRL with fast shipping

TechCrunch | One More Thing…
techcrunch.com

I sat down last night to write about Steve Jobs' resignation as Apple CEO and something funny happened: I had nothing to say. This is not no

iCloud.com developer beta opens, includes full-featured web interface
www.tuaw.com

Remember when I told you there would still be iCloud web apps once the service took over MobileMe, despite what some other sites were saying

Apple launches 1st generation iPod nano replacement program
www.tuaw.com

Apple has sent out emails to registered owners of 1st generation iPod nanos stating that certain iPod nanos created between September 2005 a