Scrippets — the way to refine Snippets Application

4,797 views

Published on

This presentation introduces new feature available in the Snippets code manager for Mac OS X.

More information at our site: www.snippetsapp.com

Special thanks to: Andrei Dolgushin, Aleks Nesterow, Pavel Zhytko, Jeff Shilling, Chris Rault, Edgar Gonçalves.

Published in: Technology, Design
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,797
On SlideShare
0
From Embeds
0
Number of Embeds
2,513
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Scrippets — the way to refine Snippets Application

  1. 1. Scrippets What they are and how they work
  2. 2. Code Snippets Pieces of re-usable code <body> <div id="page-wrap"> <!-- general HTML here --> </div> </body> HTML SQL Centered Webpage #page-wrap { width: 800px; margin: 0 auto; } CSS …
  3. 3. Snippets App Code manager for Mac OS X
  4. 4. Snippets App Supported features ✓ Syntax highlighting ✓ Smart groups ✓ Folders ✓ Labels ✓ Quick search ✓ Menu bar integration
  5. 5. What do we want to do with snippets? • Collect • Search • Edit • Sync • Manage • Export • Copy • Import • Paste • Share
  6. 6. Snippets App We’re almost there ✓ Collect ✓ Search ✓ Edit ✓ Sync ✓ Manage • Export ✓ Copy • Import ✓ Paste ✗ Share ✓ Fully Implemented • Partially implemented ✗ Not implemented
  7. 7. Export ✓ Source code ✓ PDF ✓ RTF ✓ HTML* ✓ HTML+CSS* ✓ * — in development
  8. 8. Export ✓ Source code ✗ XML ? ✓ PDF ✗ ZIP ✓ RTF ✗ FTP ✓ HTML* ✗ Web ✓ HTML+CSS* ✗ etc. ✓ * — in development
  9. 9. Import ✓ Pasteboard ✓ Selection ✓ File system ✓ iDisk
  10. 10. Import ✓ Pasteboard ✗ XML ? ✓ Selection ✗ ZIP ✓ File system ✗ FTP ✓ iDisk ✗ Web ✗ etc.
  11. 11. Share So many services all over the place: Pastie Lodge It Paste2 DZone Snippets Snipt.org Gist Snipt.net GnoPaste Snipplr Pastebin.ca Droplr TinyPaste Pastebin.com YFS* … ✓ * — your favorite service
  12. 12. Conclusion It’s almost impossible to cover all use cases by standalone features…
  13. 13. Problem Here’s the challenge we’re facing How to implement advanced Export, Import and Sharing?
  14. 14. Fact Export, Import and Sharing have something in common
  15. 15. Fact Export, Import and Sharing have something in common These are custom operations on snippets
  16. 16. Solution Offered by the Snippets App Provide a platform to run custom operations on selected snippets!
  17. 17. Example How to share via Snipplr 1 Select snippets
  18. 18. Example How to share via Snipplr 1 Select snippets 2 Enter API Key User-speci c string provided by the Snipplr service to allow authorized API-requests 827364827301
  19. 19. Example How to share via Snipplr 1 Select snippets 2 Enter API Key 3 Upload snippets 827364827301 Script
  20. 20. Example How to share via Snipplr 1 Select snippets 2 Enter API Key 3 Upload snippets 4 Display links snipplr.com/?id=1 snipplr.com/?id=2 snipplr.com/?id=3 snipplr.com/?id=4 827364827301 Script
  21. 21. Example How to share via Snipplr 1 Select snippets 2 Enter API Key 3 Upload snippets 4 Display links snipplr.com/?id=1 snipplr.com/?id=2 snipplr.com/?id=3 snipplr.com/?id=4 827364827301 Script Custom operations
  22. 22. Example How to share via Snipplr 1 Select snippets 2 Enter API Key 3 Upload snippets 4 Display links snipplr.com/?id=1 snipplr.com/?id=2 snipplr.com/?id=3 snipplr.com/?id=4 827364827301 Script HTML Ruby HTML +JavaScript (Perl, Bash, +JavaScript +CSS Python) +CSS Custom operations
  23. 23. Example How to share via Snipplr 1 Select snippets 2 Enter API Key 3 Upload snippets 4 Display links input.html uploader.rb output.html Step 1: Step 2: Step 3: Authorization Uploading Result Custom Steps
  24. 24. Snippets App Provides a mechanism to run any number of steps as… input.html uploader.rb output.html Step 1: Step 2: Step 3: Authorization Uploading Result Scrippet
  25. 25. Scrippet Collection of scripts and resources <html lang="en"> require 'net/http' <html lang="en"> <head> require 'uri' <head> ! <meta http- ! <meta http- equiv="Content-Type" snipplr_url = equiv="Content-Type" + + content="text/html; Net::HTTP.post_form content="text/html; charset=utf-8"> (url, charset=utf-8"> </head> parameters).body.matc </head> <body> h(/href="([^"]+)"/) <body> <input></input> [1] <div></div> </body> snipplr_url = </body> </html> snipplr_url.gsub… </html> input.html uploader.rb output.html Scripts + Resources = Scrippet
  26. 26. Scrippet Can be developed to automate almost any task you want ✓ Export ✓ Tweet ✓ Import ✓ Transform ✓ Share ✓ Evaluate ✓ Backup ✓ Run
  27. 27. Scrippet Includes property list describing all steps to perform </> </> <Scrippet> <Name>Share via Snipplr.com</Name> <Icon>snipplr.png</Icon> <Steps> <Step> <Name>Security Options</Name> <Source>input.html</Source> </Step> <Step> <Name>Uploading…</Name> input.html uploader.rb output.html <Source>uploader.rb</Source> </Step> <Step> <Name>Result</Name> <Source>output.html</Source> Aa </Step> </Steps> </Scrippet> S info.plist scrippet.js default.css snipplr.png
  28. 28. Scrippet Is a folder with .scrippet extension Snipplr.scrippet root of the package / Contents info.plist property list / Resources / input.html UI for the 1st step / uploader.rb script for the 2nd step / output.html UI for the 3rd step / scrippet.js scrippet APIs / default.css CSS styles / snipplr.png icon image
  29. 29. Scrippets Are recognized by Mac OS X as Bundles Snipplr Pastie Snipt.org …
  30. 30. Scrippets Can be installed and executed by the Snippets App Pastie
  31. 31. Scrippets You can develop them Developers
  32. 32. Scrippets Easy to share over the internet Developers Internet
  33. 33. Scrippets Everyone can use them Developers Internet Happy users
  34. 34. What’s Next Developers Internet Happy users Easy & powerful Public scrippet Pastie, Snipplr, APIs will be database is in Snipt.org scrippets published soon development* are available now; more in development ✓ * — all scrippets will be tested for security before publishing
  35. 35. Summary ✓ Snippets application is a cool code manager for Mac OS X ✓ Now we have universal solution for extending its functionality ✓ Scrippets let you create powerful custom scenarios ✓ Everybody can develop and use them
  36. 36. www.snippetsapp.com @snippetsapp

×