Settings

Theme

Show HN: ICanHazData – Data URI Swiss Army Knife

icanhazdata.com

257 points by chadscira 9 years ago · 5 comments

Reader

orf 9 years ago

I get why you might want to make this, but isn't it just a one-liner?

> echo "data:$(file -b --mime-type somefile);base64,$(base64 somefile)"

  • chadsciraOP 9 years ago

    Yeah, but its a pain in the butt to iterate when doing that, especially when you just want to dump off clipboard, or drag & drop.

    Also wanted an excuse to play with a few browser features :P.

    • orf 9 years ago

      Ahh I see, I can imagine that being a pain (especially with the clipboard). Nice app!

      • pvsnp 9 years ago

        How about this in OSX? echo "data:$(file -b --mime-type filename);base64,$(base64 filename)" | pbcopy

        or for linux, your favorite variant of pbcopy using xsel or xcopy?

        Not to say this isn't a great tool.

chadsciraOP 9 years ago

This was made to make playing with Data URI's much easier.

I find myself often needing a quick way to generate a Data URI when playing with files on jsfiddle, or codepen (due to CORS). So I thought it would be nice to have a website that locally stores those files.

This was thrown together in a couple of hours (using react/mobx), and inspired by [0] "The XSS Game By Google post". It turned out that quite a few people didn't know that you could use URI's for things that were not images.

If you have any suggestions feel free to voice them :)

- [0] https://news.ycombinator.com/item?id=13021869

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection