Logo

Who is talking?

Archive

Building a Browser IDE

almost 5 years ago | Alex Rothenberg: Alex Rothenberg

Its become so easy to share code examples as gists but once you start sharing html, css or javascript you can do so much more than share static code. Browsers can run html, css and javascript so we can actually run the code we’re sharing. Let’s look at how we could build a simple IDE in your browser like jsfiddle where where you can experiment with your HTML, CSS and Javascript. HTML IDE First we’re going to build an HTML editor. Try it out…I’ll wait. .demo { width:80%; margin:auto; margin-bottom:1em; } .demo iframe { width: 100%; border: 5px inset; } How does it work? We need three things. 1 - A textarea where you can type in the html <textarea id="html" class="content"> Hi there this is some <b>bold</b> content and this is <i>italic</i>. <p>Pretty cool huh!</p> <p>What else can you type?</p> </textarea> 2 - An iframe to preview the page <iframe id="preview" class="content"></iframe> 3 - Some javascript to copy the html from the text area into the div $('#html').keypress(function() { $('#preview').contents().find('html').html($(this).val()) }) After we add some formatting and put it all together we get a page like this. http://www.alexrothenberg.com/examples/browser_ide/html_ide.html <html> <head> <meta charset=utf-8> <title>Browser IDE</title> <link rel="stylesheet" href="./styles.css" type="text/css" charset="utf-8"> <script src="jquery.min.js"></script> <script type='text/javascript'> $(function() { $('#html').keyup(function() { $('#preview').contents().find('body').html($(this).val()) }) $('#html').keyup() // Initialize }) </script> </head> <body> <h1>Edit the HTML and see it in the Preview</h1> <div class="box"> <div class="label">HTML</div> <textarea id="html" class="content"> Hi there this is some <b>bold</b> content and this is <i>italic</i>. <p>Pretty cool huh!</p> <p>What else can you type?</p> </textarea> </div> <div class="box"> <div class="label">Preview</div> <iframe id="preview" class="content"></iframe> </div> </body> </html> HTML and CSS IDE HTML is good but any self respecting webpage will also have a CSS file. We can add that too. To get this working we added 1 - A new textarea where you can type in the css <textarea id="css" class="content"> .warning { color: red; } </textarea> 2 - Some javascript to copy the css from the text area into the div $('#css').keypress(function() { preview_contents.find('head style').remove() preview_contents.find('head').append("<style>" + $(this).val() + "</style>") }) All put together it looks like this. http://www.alexrothenberg.com/examples/browser_ide/html_css_ide.html <html> <head> <meta charset=utf-8> <title>Browser IDE</title> <link rel="stylesheet" href="./styles.css" type="text/css" charset="utf-8"> <script src="jquery.min.js"></script> <script type='text/javascript'> $(function() { var preview_contents = $('#preview').contents() $('#html').keyup(function() { preview_contents.find('body').html($(this).val()) }) $('#css').keyup(function() { preview_contents.find('head style').remove() preview_contents.find('head').append("<style>" + $(this).val() + "</style>") }) $('#html').keyup() // Initialize $('#css').keyup() // Initialize }) </script> </head> <body> <h1>Edit HTML and CSS</h1> <div class="box"> <div class="label">HTML</div> <textarea id="html" class="content"> <div class="warning">This is a warning!</div> <div class="message">This is a message.</div> </textarea> </div> <div class="box"> <div class="label">CSS</div> <textarea id="css" class="content"> .warning { color: red; } /* Try adding a .message style. Make it bold. */ </textarea> </div> <div class="box"> <div class="label">Preview</div> <iframe id="preview" class="content"></iframe> </div> </body> </html> HTML, CSS and Javascript IDE So the last part of the page we want to edit is javascript. We implement this following the same pattern we’ve been using. 1 - A new textarea where you can type in the javascript <textarea id="javascript" class="content"> // Change the next line and watch the preview change var new_text = 'This text was added by js' var js_element = document.getElementById('js_content') js_element.innerHTML = new_text </textarea> 2 - Some javascript to copy the css from the text area into the div $('#javascript').keypress(function() { preview_contents.find('head script').remove() var created_script = preview_contents[0].createElement('script'); created_script.text = $(this).val() preview_contents.find('head')[0].appendChild(created_script) }) Here’s the complete page. http://www.alexrothenberg.com/examples/browser_ide/html_css_js_ide.html <html> <head> <meta charset=utf-8> <title>Browser IDE</title> <link rel="stylesheet" href="./styles.css" type="text/css" charset="utf-8"> <script src="jquery.min.js"></script> <script type='text/javascript'> $(function() { var preview_contents = $('#preview').contents() $('#html').keyup(function() { preview_contents.find('body').html($(this).val()) $('#javascript').keyup() // let the javascript change the page }) $('#css').keyup(function() { preview_contents.find('head style').remove() preview_contents.find('head').append("<style>" + $(this).val() + "</style>") }) $('#javascript').keyup(function() { preview_contents.find('head script').remove() var created_script = preview_contents[0].createElement('script'); created_script.text = $(this).val() preview_contents.find('head')[0].appendChild(created_script) }) $('#html').keyup() // Initialize $('#css').keyup() // Initialize $('#javascript').keyup() // Initialize }) </script> </head> <body> <h1>Edit HTML, CSS and Javascript</h1> <div class="box"> <div class="label">HTML</div> <textarea id="html" class="content"> <div class="warning">This is a warning!</div> <div class="message">This is a message</div> <div id="js_content"></div> </textarea> </div> <div class="box"> <div class="label">CSS</div> <textarea id="css" class="content"> .warning { color: red; } </textarea> </div> <div class="box"> <div class="label">Javascript</div> <textarea id="javascript" class="content"> // Change the next line and watch the preview change var new_text = 'This text was added by js' var js_element = document.getElementById('js_content') js_element.innerHTML = new_text </textarea> </div> <div class="box"> <div class="label">Preview</div> <iframe id="preview" class="content"></iframe> </div> </body> </html> Syntax highlighting We now have a very simple IDE but its missing something all code editors have. No I don’t mean “save”, although that is important I’m going to ignore it. When I’m typing text it all starts to run together and become really hard to read. It would be so much easier if we had some syntax highlighting. We’re going to use a javascript library called CodeMirror which knows how to syntax highlight html, css, javascript and a ton of other languages. When we’re done it will be much easier to read our code We’ll add CodeMirror in these 3 steps. 1 - First we download CodeMirror and save it along with our files. 2 - Now we need to add it to our page <link rel="stylesheet" href="./codemirror/codemirror.css"> <script src="./codemirror/mode/javascript/javascript.js"></script> <script src="./codemirror/mode/css/css.js"></script> <script src="./codemirror/mode/xml/xml.js"></script> <script src="./codemirror/mode/htmlmixed/htmlmixed.js"></script> 3 - Finally some javascript that enables CodeMirror on our three textareas. Here’s the code for the html pane. CodeMirror.fromTextArea($('#html')[0], { mode: "htmlmixed", matchBrackets: true, onChange: function(editor) { copyHTML(editor.getValue()) } }) var copyHTML = function(html_text) { preview_contents.find('html').html(html_text) copyJavascript($('#javascript').val()) // let the javascript change the page } copyHTML($('#html').val()) // Initialize CodeMirror actually offers a ton more functionality than just syntax highlighting like emacs or vim keybinding, matching parentheses, undo, and more that you can investigate if you’re interested. When we’re done with all that we have this single page app. http://www.alexrothenberg.com/examples/browser_ide/index.html <html> <head> <meta charset=utf-8> <title>Browser IDE</title> <link rel="stylesheet" href="./styles.css" type="text/css" charset="utf-8"> <script src="jquery.min.js"></script> <script src="./codemirror/codemirror.js"></script> <link rel="stylesheet" href="./codemirror/codemirror.css"> <script src="./codemirror/mode/javascript/javascript.js"></script> <script src="./codemirror/mode/css/css.js"></script> <script src="./codemirror/mode/xml/xml.js"></script> <script src="./codemirror/mode/htmlmixed/htmlmixed.js"></script> <script type='text/javascript'> $(function() { var preview_contents = $('#preview').contents() CodeMirror.fromTextArea($('#html')[0], { mode: "htmlmixed", matchBrackets: true, onChange: function(editor) { copyHTML(editor.getValue()) } }) CodeMirror.fromTextArea($('#css')[0], { mode: "css", matchBrackets: true, onChange: function(editor) { copyCSS(editor.getValue()) } }) CodeMirror.fromTextArea($('#javascript')[0], { mode: "javascript", matchBrackets: true, onChange: function(editor) { copyJavascript(editor.getValue()) } }) var copyHTML = function(html_text) { preview_contents.find('body').html(html_text) copyJavascript($('#javascript').val()) // let the javascript change the page } var copyCSS =function(css_text) { preview_contents.find('head style').remove() preview_contents.find('head').append("<style>" + css_text + "</style>") } var copyJavascript =function(javascript_text) { preview_contents.find('head script').remove() var created_script = preview_contents[0].createElement('script'); created_script.text = javascript_text preview_contents.find('head')[0].appendChild(created_script) } copyHTML($('#html').val()) // Initialize copyCSS($('#css').val()) // Initialize copyJavascript($('#javascript').val()) // Initialize }) </script> </head> <body> <h1>Edit HTML, CSS and Javascript with Syntax Highlighting</h1> <div class="box"> <div class="label">HTML</div> <textarea id="html" class="content"> <div class="warning">This is a warning!</div> <div class="message">This is a message</div> <div id="js_content"></div> </textarea> </div> <div class="box"> <div class="label">CSS</div> <textarea id="css" class="content"> .warning { color: red; } </textarea> </div> <div class="box"> <div class="label">Javascript</div> <textarea id="javascript" class="content"> // Change the next line and watch the preview change var new_text = 'This text was added by js' var js_element = document.getElementById('js_content') js_element.innerHTML = new_text </textarea> </div> <div class="box"> <div class="label">Preview</div> <iframe id="preview" class="content"></iframe> </div> </body> </html> This entire sample we’ve built is on github at https://github.com/alexrothenberg/alexrothenberg.github.com/tree/master/examples/browser_ide.

Eclipse Tips

almost 5 years ago | Subodh Gupta: Subodh's Blog

 Escape string while pasting in the editorGo to Window > Preferences, type escape in the search field. Go to Java > Editor > Typing preference page. In last group label "String literals" select the "Escape text when pasting into a string literal".

Aavarana by S. L. Bhyrappa

about 5 years ago | Niranjan Sarade: InLoveWithNature

Recently I read a Marathi translated version of a novel called 'Aavarana(2007)'. The book has been originally written in Kannada by the bestselling novelist Professor S.L.Bhyrappa and translated in Marathi by Uma Kulkarni. The novel portrays the relationship between Hinduism and Islam - in the past and in the present, with two stories going on a parallel track.The term 'Aavarana' is used in Vedantic literature to denote that aspect of nescience (Avidya) that obscures all things. It is the 'Avidya' that hides the real truth behind its covers. Prof. SL Bhyrappa chose the same name to his novel because he wanted to highlight the current so called Secular and Social faces in India who are trying to hide the real truth with the help of political support. The book is very informative as the author has actually referred to many books himself before writing this novel. This list can be found at the end of the book nicely included as a part of the story. The incidents that he has narrated by means of a story are based on these references. The author has made very clear that the relationships between communities should be based on a strong foundation of truth rather than systemic misinformation. To be frank, today's education about the Indian history lacks the truth.One should definitely read this book and have an introspection about what we have been taught since childhood and what is the actual truth. Certainly, no one should feel against Islam or any other religion, that is not the book's intent as clearly stated by the author. The intent is to understand that no relationship can stand successful if it is not based on a strong foundation of truth. Because truth will never die!

A Huge Issue in PHPStorm

about 5 years ago | Eduard Moldovan: eduardmoldovan.com - tech

I have recently switched to Jetbrains PHPStorm because of its code completion, code highlight and many other features. But it has one huge problem, which, if not fixed, is going to make me ditch it.

CXF JSON Generation remove @ prefix

about 5 years ago | Subodh Gupta: Subodh's Blog

Working with CXF-RS if you want to generate the json response along with xml than it becomes pain in cases where your xml is a mixture of attributes and elements. Problem comes because of default jettison json provider which is configured in cxf-rs. The jettison appends the '@' prefix  with the attributes. However, I needed json free from any prefixes. To achieve this i had configure jackson as json provider like this:       <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings></xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument></xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles></xml><![endif]--><!--[if gte mso 10]><style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} </style><![endif]-->         <jaxrs:providers>            <ref bean="jaxbProvider" />            <ref class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>        </jaxrs:providers>                         That's it and you should be free from prefixes.

Tuning up Heroku

about 5 years ago | Shadab Ahmed: Shadab's Blog

So now you have deployed your site on Heroku, it’s time to make it fast, responsive, backed-up and analytics enabled. With Heroku you can do all these thing for free .. yayyy (atleast at the time of writing this blog post) Solve Heroku Startup Delay If you are using Heroku free for your RoR(Rails 3.0) app you might be noticing long startup delays. This happens because if your site has fairly low footfall, which it would obviously have when you have just launched your app. What happens is that heroku unloads your app if there is no activity for some time. You can very easily simulate traffic to your site and keep the heroku dyno(app engine) active by adding a cron on any machine which runs 24/7: #cron entry for wget. Every 15 minutes */15 * * * * wget http://www.yoursite.com/ -o /dev/null I have noticed site load time fall down to 1.5s from 10-20s when accessing the site after a while. Add Caching First you have to enable caching for your app. See here to add caching to you app. Now, go to your app folder and the run command below to install the free memcache addon to your app: heroku addons:add memcache Now, in your Gemfile, add – gem 'dalli' Add this line in your config/environments/production.rb – config.cache_store = :dalli_store Now run: bundle update git commit -a -m 'Added memcache' git push heroku master Thats it. Your site is now cache enabled. No other configuration required. To test the cache status just run these commands after a few page hits: heroku run console > Rails.cache.status For more information see – Heroku Memcache Enable Backups Creating backups on heroku is also very easy. You can take manual backups and also enable automated backups, all for free :). Add backup addon by – heroku addons:add pgbackups:auto-month. The auto-month addon gives you maximum auto and manual addons for free. Heroku states for this addon – Daily automatic backups. Retains 7 daily backups, 5 weekly backups, and 10 manual backups . Your automatic backups will be done by Heroku. If you do need to create a manual backup, you can do by - heroku pgbackups:capture SHARED_DATABASE (DATABASE_URL) ----backup---> b252 Capturing... done Storing... done The value b252 is the backup id. To list all backups: heroku pgbackups ID | Backup Time | Size | Database -----+---------------------+---------+---------------- b001 | 2012/02/19 06:34.29 | 24.5KB | SHARED_DATABASE a001 | 2012/02/20 20:00.55 | 24.5KB | DATABASE_URL b004 | 2012/02/21 22:36.57 | 24.5KB | SHARED_DATABASE a004 | 2012/02/23 20:00.55 | 24.5KB | DATABASE_URL Get download link for any backup: heroku pgbackups:url b001 #use backup id from backup list . Download the dump by curl backup_url Restore the dump to you local database using pg_restore --verbose --clean --no-acl --no-owner -h myhost -U myuser -d mydb latest.dump. Make sure that the user specified is the owner of both db and the public schema inside it. Single line backup/restore: heroku pgbackups:capture && curl `heroku pgbackups:url` | pg_restore --verbose --clean --no-acl --no-owner -h myhost -U myuser -d mydb To get more information see – Heroku pgbackups New Relic – Site Analytics Addon To analyze your site performance, heroku supports New Relic. This is also very simple to add to your app. First you just need to enable New Relic for your app – heroku addons:add newrelic:standard. This is again free :) Now in your app, add this like to your Gemfile – gem 'newrelic_rpm'. Now copy this file newrelic.yml, and save it in your config directory. Then do the usual steps of committing and pushing to Heroku and you’ll be done. To view New Relic stats, just goto your app page on heroku, click on Addons, you will see New Relic in the list. Click on that link to open the awesome dashboard like shown below:

Wah! Guru

about 5 years ago | Niranjan Sarade: InLoveWithNature

Last Sunday, I watched an excellent Marathi drama called 'Wah! Guru'. My favorite actor Dilip Prabhawalkar performed excellent in casting the character of Professor Sapre. The drama is based on Mitch Albom's best-selling novel 'Tuesdays with Morrie - an old man, a young man, and life's greatest lesson'. It is a story of courage and optimism of Professor Sapre who is diagnosed with the terminal illness of Motor Neuron Disease (MND), a very rare disease due to which the patient loses his muscular control and finally succumbs to it. But Prof. Sapre asks himself - Do I wither up, or do I make the best of my time left?He makes Death as his final project. Since everyone is going to die, his death can be taught in personal class, that's what he thinks. He starts teaching the bridge between life and death to one of his students by narrating small inspirational stories. And the student actually benefits from his teachings, his positive attitude.I liked this dialog - 'When you're in bed, you're dead!'And also this conversation between the student and the professor:-Student : "Why should we care or think about death now as it approaches towards end of our life ?" Professor : "My thinking is opposite. The life ends when death approaches us. And hence we need to think of Death every day."The ebook is available @TuesdaysWithMorrieSo, please watch this wonderful drama or read the book if you haven't already ! Needless to say that my next plan is to read this book ! :-)

I love this section in my newspaper..

about 5 years ago | Nirmal Merchant: Urban Gypsy

I love this section in my newspaper..

Lol…the fun in being married..

about 5 years ago | Nirmal Merchant: Urban Gypsy

Lol…the fun in being married..

Making Gedit look like Textmate for Ubuntu

about 5 years ago | Niranjan Sarade: InLoveWithNature

Textmate is the most popular editor tool available exclusively only for Mac OS. Developers love it due to its simplicity, lightweightness and excellent feature set availability. While working on Ubuntu (11.10 64-bit), we have the default gedit editor available which is also very good. However, if we want to have some Textmate like features with gedit, we can follow these simple steps to make gedit look like Textmate:-(1) Installing extra gedit plugins :-$ sudo apt-get install gedit-plugins(2) Installing Textmate 'Monaco' fontDownload from http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf and execute below commands:(3) Installing syntax color scheme darkmate.xmlDownload the darkmate.xml file from http://grigio.org/files/darkmate.xmlFrom gedit, go to Edit -> Preferences -> Font & Colors. Then click Add button and locate the download file(darkmate.xml). Also select the Monaco font.(4) Activating installed plugins from gedit -> Edit -> Preferences -> PluginsFrom this pane,we can enable following plugins as per our requirements :--Bracket Completion-Code Comment-File Browser Panel-Snippets-Word Completion, etc.With these settings, your gedit now looks like Textmate :- If you want to avoid the above steps, then we have also another option called Gmate. GMate is a collection of plugins, themes/styles and other improvements to get TextMate-like features in Gedit. The package will add some themes and plugins you can enable/disable from the Gedit preferences. To install GMate in Ubuntu, use the following commands:In the upcoming posts, we will also try some other text editors available for Linux Ubuntu.

Some thoughts on Vendor Prefixes

about 5 years ago | Ben Gilles: Ben Gillies

Remy Sharp writes]:Browsers need to:Fucking drop experimental prefixes. It’s unacceptable and a disservice to the developers working with your browser. You need to give timelines to dropping these things.Non-production ready browsers should support experimental prefixes, production ready releases should not. If it’s Chrome 16 - the stable version - experimental support should not be baked in. The properties should be full available without the prefix.Work with the working groups (…Apple).I agree with all of these points, but at the same time, I can’t see it actually happening. I just can’t see Google or Apple actually removing features from their browsers and moving them all into beta in perpetuity (because let’s face it, the standards process takes far far too long). Even if this did happen, I can well imagine most developers (and people who want these features) just switching to the beta and using that as their default browser, as most betas are fairly stable these days. That’s not solving the problem. It’s just moving it to another place.I’ve seen two comments on Twitter that really resonated with me about all this. The first, from psd, states:the problem with vendor prefixes is the namespace is used to target a browser vendor rather than disambiguating similar proposed featuresAnd strikes me as the current problem with vendor prefixes. Sure, the best features win out in the end (take the gradient syntax for example), but as it currently stands, the best feature ties rather too closely into the browser that implemented it. The solution would then be to drop the browser specific prefixes, and adopt feature based prefixes that, when they become popular, other browsers can implement and test out as well.The other comment on Twitter, was part of a conversation between Mike Mahemoff and Alex Russel and mentions the CSS Mixin proposal.The thought occurs to me that new features and proposals, when implemented in JavaScript, are never really a problem. This is, to a large extent, due to the presence of shims and polyfills, that abstract all the browser differences away with the inclusion of a single script tag (think the es5shim for example).Such solutions already exist for CSS, but they all involve either a build step (yuck!) or running all of your CSS through JavaScript first (yuck again!). I’m going to name this “The Dart Approach”, as it aims to solve the problems with CSS by forcing you to write something that isn’t CSS. The CSS mixin proposal would solve all of this in one step by allowing you to include a single CSS file (presumably from a CDN somewhere) that includes cross browser definitions for non-standard features. Then you just keep going as normal, and should anyone want to use a webkit only feature, they can go right ahead, safe in the knowledge that if Mozilla, for example, implement a similar feature (with their own prefix), it will just automatically work (as soon as the CDN is updated of course).Developers are lazy. Browser makers don’t want to remove features (or relegate them to beta only). As with Piracy, the solution is not to educate the pirates (or in this case, developers/designers/browser makers); the solution is to make it easier to be cross browser compatible than to not be cross browser compatible (in much the same way jQuery does). CSS mixins seems to be a good way to accomplish this.The only real problem now, is how quickly we can get it through the standards process (a problem in itself). via TiddlySpace [source]

Setting up your RoR app on Heroku

about 5 years ago | Shadab Ahmed: Shadab's Blog

If you are looking to host your rails site for free(or even paid) without worrying about server configuration etc , think no further than Heroku. Heroku is one of the most awesome cloud platforms to host your app with minimal fuss. You can find many guides and quick starts for heroku but you may still spend hours looking at multiple guides. So if you are set out to do exactly what I wanted to do i.e. Deploy my app on heroku at my domain, this blog will be helpful. Tested on Ubuntu 11.10 Setting up git First we need to setup your application’s git repository. Ignore if you have already set this up. git init touch .gitignore git add . git commit # This will create a local repository Install and Setup Heroku sudo apt-get install heroku-toolbelt heroku login # login with your heroku username and password heroku create --stack cedar # create heroku app for the local app. This is for rails 3.1+. Do this in your app directory Verifying Heroku Setup Confirm your app has been created by – git config -l. Output should be like: user.name=Shadab Ahmed user.email=*******@gmail.com core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.heroku.url=git@heroku.com:empty-samurai-3618.git remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/* Heroku will become just like another remote repository for you app where you can push commits. Deploying on Heroku Deploying is as simple as a git push. git commit -a git push heroku master If successful you will get your app url you can visit to see the app. You can also rename your app with heroku rename newappname. Now your app will be available on http://newappname.herokuapp.com Setting up your domain for your app If you want to access your app through http://yourdomain.com instead of http://appname.herokuapp.com. Setting up your domain is very simple: heroku addons:add custom_domains heroku domains:add yourdomain.com # Setup your domain for your current heroku app Setup A-Records for your domain for the following IPs: 75.101.163.44 75.101.145.87 174.129.212.2 Also setup C-Name record for your domain www.yourdomain.com appname.herokuapp.com That’s it. You app has been setup and you can access it using http://yourdomain.com . You might want to optimize your site after this. See my post for setting up backups, analytics and performance tuning of your app on Heroku – Tuning Heroku Good Luck! P.S. Heroku free account only supports postgres database as of now. I would recommend using postgres for your test, development and production environments for the sake of consistency

CXF-RS: Java Code Generation from xml/xsd

about 5 years ago | Subodh Gupta: Subodh's Blog

Cleaner approach is to use xjc like this:Continue to dirty approach below if u need to:When working with CXF-RS services often we start with XML message that will be served. After that we go through endless iteration of generating the right Java POJO's for the XML. The library like apache XMLBeans generate the Java code but the code generated is not what a developer would write and generally tedious to modify and understand.I have come across a work around for generating Java classes from XSD (xml) which is very close to what a developer with decent experience will write. Follow the steps given below to explore the solution:1. Generate the wsdl from from xsd as given in at this link (http://cxf.apache.org/docs/xsd-to-wsdl.html).2. The Java classes can be generated from wsdl from maven plugin entry below find complete details here http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html org.apache.cxf cxf-codegen-plugin ${cxf.version} generate-sources generate-sources ${project.build.directory}/generated/cxf ${basedir}/src/main/wsdl/myService.wsdl wsdl2java Hope this reduce your headache. Happy coding :)

Recording tests with JMeter

about 5 years ago | Niranjan Sarade: InLoveWithNature

We had a requirement of load/performance testing in one of my earlier projects. Instead of using commercial and expensive Silk performer, we gave a try to open source Apache JMeter and it worked really well for the purpose that we were looking for.The Apache JMeter is an open source software, a 100% pure Java application designed to load test functional behavior and measure performance.There is an excellent step by step guide available @JMeter proxy Step-by-step for how to record tests with JMeter. The guide explains the steps for creating a test plan with JMeter's proxy. The proxy records the requests sent to the server.There are different kind of Listeners available for viewing load test results like Aggregate Report, Aggregate Graph, Summary Report, View Results Tree, Monitor Results, etc. Sharing one sample output of Aggregate Report :-While setting up the load tests, we also need to take care of some config elements for more accurate results like HTTP Cookie Manager, HTTP Authorization Manager,HTTP Cache Manager, HTTP Request Defaults,HTTP Header Manager, etc. I could not go through all the elements of test plan in depth due to time constraint, but one can go through these documentation links for stepping into more technical details :-- JMeter User Manual - Elements of a Test Plan- Component Reference

Installing VM(with Ubuntu + RVM + Ruby + Rails) on my Windows 7 system

about 5 years ago | Niranjan Sarade: InLoveWithNature

I wanted to give a try on my Windows 7 system to create and run Virtual Machine with Ubuntu OS. As my colleague Manohar rightly pointed out the reason @Ruby on Rails Development Platform in Enterprise behind this, I followed the instructions to install VMWare and Ubuntu on my Windows 7 laptop.A. Download and Install VMWare Player which is free for personal non-commercial use. B. Download 64-bit ISO of Ubuntu.C. Create a New Virtual Machine for Ubuntu 64-bit using VMware Player. The steps are simple. It takes default 512 MB of RAM but I allocated 2 GB of RAM. It took me around 1 and half hour to install all the necessary files for ubuntu. So have a patience!My host system configuration :-Processor: Intel Core Dual i5 CPU, RAM: 6GB, 64-bit Operating System, Windows 7 Home PremiumSome issues that I faced and the corresponding resolution :-(1) With Ubuntu 32-bit(recommended) ISO file download, the VMWare could not identify the 64-bit Ubuntu OS. So I downloaded 64-bit ISO file for Ubuntu 11.10 verison. With this file, the VMWare was able to detect 64-bit Ubuntu OS correctly.(2) When I went ahead with the installation, I got 2 warnings/errors :-To run virtualization software and virtual machines, hardware virtualization technology should be enabled. I enabled Virtualization Technology (VT) in motherboard BIOS settings which is disabled by default and then restarted my machine. This resolved my issue and Ubuntu(64-bit) was then successfully installed on my VM.I followed the steps mentioned @Ubuntu, Ruby, RVM, Rails, and You to install RVM, Ruby 1.9.3, Rails 3.1.3 and mysql2. The steps are self explanatory and straight forward to follow. Thanks to Ryan Bigg for this !Now I am ready to try out some ruby/rails development on Ubuntu @ my home pc :-)

Snaps from Sudhagad fort

about 5 years ago | Niranjan Sarade: InLoveWithNature

My wife and I recently visited Sudhagad fort near Pali. Sharing few snaps captured from Sudhagad fort. (Sunset view is my favorite! :-)Tailbaila view from top :-Sunset view :-Enjoy the nature beauty ! :-)

My Enki Fork - An RoR blogging engine

about 5 years ago | Shadab Ahmed: Shadab's Blog

I have been thinking of setting up my blog for a long time. However, I did not want to host a generic wordpress/blogspot blog. Wanted something which I have more control over and I can add features over time. Thats how I ended up with enki . It’s a very simple rails blogging engine which you can customize very easily. Here’s what I changed from the original source: It’s a complete portfolio site and not just a blog anymore. You can add description, cv and projects list. You blog will be under /blog scope. Styles added from Twitter Bootstrap project Performance improvements and analytics to it using Dalli(memcache) and New Relic. Social media bar for each post. Facebook and Google plus right now Disqus comments Changed db to postgres from sqlite for deployment at heroku (Heroku only supports postgres for free accounts). You can see my github fork at : https://github.com/shadabahmed/shadabahmed.com. Follow the steps below to setup your enki clone on Ubuntu 11.10 Install git and checkout code: sudo apt-get install git git clone https://github.com/shadabahmed/shadabahmed.com.git enki Install Postgres database: sudo apt-get install postgresql sudo -u postgres psql postgres Change password to “postgres” – postgres-# \password postgres Exit psql shell – postgres-# \q Create databases: sudo -u postgres createdb enki_test sudo -u postgres createdb enki_dev sudo -u postgres createdb enki_prod Install modified Enki App: Goto app folder and run: cd enki bundle install bundle exec rake db:migrate To customize the blog: Edit config/enki.yml Change title Change the open_id setting under author. Open ID is be an url which you can get from your Open ID provider. You might already be having it. See this Now test the app locally – rails s Open http://localhost:3000/admin and enter your Open ID url. This will ask for authentication and you are through. You can also skip this in development mode. If you wish to host this at heroku, see my post on setting up RoR app at heroku – here

[OFF] Refrigerator usability

about 5 years ago | Eduard Moldovan: eduardmoldovan.com - tech

This might look like a very unusual topic from a webdev. But this has been itching me for a while, so let me put it into words.