<html><head></head><body bgcolor="#FFFFFF"><div>Next version of O2 has full Git support :)<br><br>Dinis Cruz</div><div><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> OWASP O2 Platform Blog <<a href="mailto:donotreply@wordpress.com">donotreply@wordpress.com</a>><br>
<b>Date:</b> 18 March 2012 06:15:16 GMT<br><b>To:</b> <a href="mailto:o2@ddplus.net">o2@ddplus.net</a><br><b>Subject:</b> <b>[New post] Testing using GitGub hosted images for <a href="http://WordPress.com">WordPress.com</a> blog posts</b><br>
<br></div></blockquote><div></div><blockquote type="cite"><div>


        
        <title>WordPress.com</title>
        
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">




<table border="0" cellspacing="0" cellpadding="0" bgcolor="#DDDDDD" style="background:#dddddd;width:100%">
        <tbody><tr>
                <td>
                        <table border="0" cellspacing="0" cellpadding="0" align="center" style="padding:10px;width:100%" class="subscribe-body">
                                <tbody><tr>
                                        <td>
                                                <div style="max-width:600px;margin:0 auto;overflow:hidden">
                                                        <table border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff" style="background-color:#fff;text-align:left;margin:0 auto;max-width:1024px;min-width:320px;width:100%" class="subscribe-wrapper">
                                                                <tbody><tr>
                                                                        <td>
                                                                                <table border="0" cellspacing="0" cellpadding="0" height="8" background="http:/s.wordpress.com/i/emails/stripes.gif" style="background-image: url( 'http:/s.wordpress.com/i/emails/stripes.gif'); background-repeat: repeat-x; background-color: #43A4D0; height: 8px; width: 100%;" class="subscribe-header-wrap">

                                                                                        <tbody><tr>
                                                                                                <td></td>
                                                                                        </tr>
                                                                                </tbody></table>

                                                                                <table border="0" cellspacing="0" cellpadding="0" style="color:#0088cc;margin:0 0 5px 0;font-size:1.6em;color:#0088cc;margin:0 0 0px 0;font-size:1.6em;background-color:#efefef;padding:0;border-bottom:1px solid #ddd;width:100%" class="subscribe-header">

                                                                                        <tbody><tr>
                                                                                                <td>
                                                                                                        <h2 style="padding:0px;margin:5px 20px;font-size:16px;line-height:1;font-weight:normal;color:#464646;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif" class="subscribe-title">
                                                                                                                New post on <strong>OWASP O2 Platform Blog</strong>                                                                                                 </h2>
                                                                                                </td>
                                                                                                <td style="text-align:right">
                                                                                                        <img border="0" style="margin: 5px 20px 5px 0; vertical-align: middle;" class="head-avatar" src="http://0.gravatar.com/blavatar/ab1f4cc4045e4797d7966804a581ec2c?s=32&ts=1332051316" alt="">
                                                                                                </td>
                                                                                        </tr>
                                                                                </tbody></table>

                                                                                <table border="0" cellspacing="0" cellpadding="20" bgcolor="#ffffff" style="width:100%">
                                                                                        <tbody><tr>
                                                                                                <td>
                                                                                                        <table border="0" cellspacing="0" cellpadding="0" style="width:100%">
                                                                                                                <tbody><tr>
                                                                                                                        <td valign="top" class="the-post">
                                                                                                                                                                                                                                                                        <table border="0" cellspacing="0" cellpadding="0" style="width:100%">
                                                                                                                                                <tbody><tr>
                                                                                                                                                        <td style="width:60px!important;white-space:nowrap;vertical-align:top">
                                                                                                                                                                <a href="http://o2platform.wordpress.com/author/o2platform/" style="display:block;margin-right:10px;text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2"><img border="0" alt="" src="http://0.gravatar.com/avatar/6976f0b2efa57eb7c7ae106e8fed0e4a?s=50&d=identicon&r=G" class="avatar avatar-50" height="50" width="50"></a>
                                                                                                                                                        </td>
                                                                                                                                                        <td>
                                                                                                                                                                <h2 style="margin:0;font-size:1.6em;color:#555;margin:0;font-size:1.6em;color:#555;font-size:20px" class="post-title"><a style="text-decoration:none!important;text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2" href="http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/">Testing using GitGub hosted images for WordPress.com blog posts</a></h2>

                                                                                                                                                                <span style="color:#888">by <a href="http://o2platform.wordpress.com/author/o2platform/" style="color:#888!important;text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">Dinis Cruz</a></span>
                                                                                                                                                        </td>
                                                                                                                                                </tr>
                                                                                                                                        </tbody></table>
                                                                                                                                
                                                                                                                                <div style="margin-top:1em;max-width:560px" class="post-content">
                                                                                                                                                                                                                                                                                        <p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">One of the things that has been a massive pain when writing these blog posts has been the really bad workflow that <a href="http://WordPress.com">WordPress.com</a> has to deal with image's uploads.</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">The workflow that I want is one where I can take a screenshot into my local clipboard and 'automagically' that image is available to be inserted in the blog (I'm happy to wait a coupe seconds as long as no other action is needed).</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">In the past, I did come up with a 'semi automated way' to upload these images via WordPressweb GUI (see <a title="Permalink to O2 Script to automatically upload clipboard images to WordPress.com" href="http://o2platform.wordpress.com/2011/04/16/o2-script-to-automatically-upload-clipboard-images-to-wordpress-com/" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">O2 Script to automatically upload clipboard images to WordPress.com</a>), but it was not 100% stable and recently that O2 script stopped working since <a href="http://WordPress.com">WordPress.com</a> changed its own image uploading code .</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">Since I'm now heavily into Git, and GitHub, I was thinking <em>'why don't I copy the image from the clipboard into a local Git Repository, then push that repository to the web, and expose the GitHub raw link available'</em></p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">And with the latest version of O2 (in .NET 4.0 + native .NET Git suport) I was able to build such Gui.</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0"><strong>Here it is in action:</strong></p>
<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0"> <img border="0" style="max-width: 100%; height: auto;" src="https://github.com/DinisCruz/Images/raw/master/images/3_18_2012_6_00_25_AM.jpg" alt=""></p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">After taking a screenshot, click on the <em>'Commit...'</em> link and eventually the image will be shown in a WebBrowser and the image URL is also placed in the clipboard (for example <a href="https://github.com/DinisCruz/Images/raw/master/images/3_18_2012_6_00_48_AM.jpg" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">https://github.com/DinisCruz/Images/raw/master/images/3_18_2012_6_00_48_AM.jpg</a>)</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">Now to add an image to a blog post (like this one), one can use the url in the clipboard, or just drag and drop the image from the WebBrowser:</p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0"><img border="0" style="max-width: 100%; height: auto;" src="https://github.com/DinisCruz/Images/raw/master/images/3_18_2012_6_00_48_AM.jpg" alt=""></p>

<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0"><strong>Here is the code that creates this GUI</strong></p>
<p style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">
</p><pre class="brush: csharp; wrap-lines: false;" style="font-size:14px;line-height:1.4em;color:#444444;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin:0 0 1em 0">var topPanel = O2Gui.open("Util - Copy Clipboard Image to GitHub Repository",400,400);
//var topPanel = panel.clear().add_Panel();
var actionsPanel = topPanel.insert_Above(40, "Actions");
var url_TextBox = topPanel.insert_Above(20).add_Label("Image Url").append_TextBox("").align_Right();
var browser = topPanel.add_WebBrowser_Control();
topPanel.insert_LogViewer();
var localRepository = @"C:\_WorkDir\O2\Images"
var nGit = new API_NGit();
nGit.open(localRepository);
actionsPanel.add_Link("Open Screenshot tool", ()=> API_Cropper.openGui())
            .append_Link("Commit image from clipboard and push",
                        ()=>{
                               
                                var image = localRepository.pathCombine("images").createDir().saveImageFromClipboardToFolder(); 
                                if (image.notNull())
                                {
                                    var o2Timer = new O2Timer("upload to Git").start();
                                    var url = "<a href="https://github.com/DinisCruz/Images/raw/master/images/{0}">https://github.com/DinisCruz/Images/raw/master/images/{0}</a>".format(image.fileName());
                                    "Current Status: {0}".info(nGit.status());
                                    nGit.add_and_commit_using_Status();                               
                                    nGit.push();
                                    "Url copied to Cliboard: {0}".info(url);
                                    url.clipboardText_Set();
                                    o2Timer.stop();
                                    browser.open(url);
                                }
                            });           

return nGit;
//O2File:API_NGit.cs
//O2File:API_Cropper.cs
//O2Ref:NGit.dll
//O2Ref:NSch.dll
//O2Ref:Mono.Security.dll
//O2Ref:Sharpen.dll

//O2Tag_DontAddExtraO2Files
</pre><p></p>
<div style="clear:both"></div>                                                                                                                                                                                                                                                                    </div>

                                                                                                                                                                                                                                                                        <div style="color:#999;font-size:0.9em;margin-top:4px;color:#999;font-size:0.9em;margin-top:4px;line-height:160%;padding:15px 0 15px;border-top:1px solid #eee;border-bottom:1px solid #eee;overflow:hidden" class="meta">

                                                                                                                                                <strong><a href="http://o2platform.wordpress.com/author/o2platform/" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">Dinis Cruz</a></strong> | March 18, 2012 at 6:15 am | Categories: <a href="http://o2platform.wordpress.com/?cat=2427" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">.NET</a>, <a href="http://o2platform.wordpress.com/?cat=5603054" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">GitHub</a>
 | URL: <a href="http://wp.me/pUfv6-nb" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">http://wp.me/pUfv6-nb</a>                                                                                                                                    </div>
                                                                                                                                
                                                                                                                                                                                                                                                                        <p style="font-size:14px;padding:0;color:#666;padding-top:1em;padding-bottom:0em;margin-bottom:0;margin-left:0;padding-left:0" class="subscribe-action-links">
                                                                                                                                                </p><table border="0" cellspacing="0" cellpadding="0" style="width:100%">
                                                                                                                                                        <tbody><tr>
                                                                                                                                                                <td style="width:10px"><a style="border-radius:10em;border:1px solid #11729e;text-decoration:none;color:#fff;text-shadow:0 1px 0 #11729e;background-color:#2585b2;padding:5px 15px;font-size:16px;line-height:1.4em;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:normal;margin-left:0;white-space:nowrap" href="http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/#respond">Comment</a></td>

                                                                                                                                                                <td>   <a style="font-size:14px;text-decoration:underline;text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2" class="subscribe-action-link" href="http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/#comments">See all comments</a></td>

                                                                                                                                                        </tr>
                                                                                                                                                </tbody></table>
                                                                                                                                        <p></p>
                                                                                                                                                                                                                                                        </td>
                                                                                                                </tr>
                                                                                                        </tbody></table>
                                                                                                </td>
                                                                                        </tr>
                                                                                </tbody></table>

                                                                                <table border="0" cellspacing="0" cellpadding="20" bgcolor="#efefef" style="background-color:#efefef;text-align:left;border-top:1px solid #dddddd;width:100%" class="subscribe-wrapper-sub">
                                                                                        <tbody><tr>
                                                                                                <td style="border-top:1px solid #f3f3f3;color:#888;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;background:#efefef" class="subscribe-content">
                                                                                                        <p style="font-size:12px;line-height:1.4em;margin:0px 0px 10px 0px">
                                                                                                                Unsubscribe or change your email settings at <a href="https://subscribe.wordpress.com/?key=3b791628ad2c78549a5f5f07698d0676&email=o2%40ddplus.net" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">Manage Subscriptions</a>.                                                                                                     </p>


                                                                                                        <p style="font-size:12px;line-height:1.4em;margin:0px 0px 0px 0px">
                                                                                                                <strong>Trouble clicking?</strong> Copy and paste this URL into your browser: <br>
                                                                                                                <a href="http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/" style="text-decoration:none;color:#0088cc;text-decoration:underline;color:#2585b2">http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/</a>
                                                                                                        </p>
                                                                                                </td>
                                                                                        </tr>
                                                                                </tbody></table>
                                                                        </td>
                                                                </tr>
                                                        </tbody></table>

                                                        <table border="0" cellspacing="0" cellpadding="0" height="3" background="http:/s.wordpress.com/i/emails/stripes.gif" style="background-image: url( 'http://s.wordpress.com/i/emails/stripes.gif'); background-repeat: repeat-x; background-color: #43A4D0; height: 3px; width: 100%;" class="subscribe-footer-wrap">

                                                                <tbody><tr>
                                                                        <td></td>
                                                                </tr>
                                                        </tbody></table>
                                                </div>
                                        </td>
                                </tr>
                        </tbody></table>

                        
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="padding-bottom:2em;color:#555555;font-size:12px;height:18px;text-align:center;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;width:100%" class="subscribe-footer">

                                        <tbody><tr>
                                                <td align="center">
                                                <a style="font-size:14px;color:#555555!important;text-decoration:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:#555!important;font-size:14px;text-decoration:none" class="subscribe-footer-link" href="http://wordpress.com">Thanks for flying with <img border="0" src="http://s.wordpress.com/i/emails/wp-footericon.png" alt="" style="vertical-align: middle;" width="16" height="17"> WordPress.com</a>                                         </td>

                                        </tr>
                                </tbody></table>

                        
                        <br>
                </td>
        </tr>
</tbody></table>

<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=o2platform.wordpress.com&blog=13405956&post=1437&subd=o2platform&ref=&email=1&email_o=wpcom" width="1" height="1">

</div></blockquote></body></html>