If you are creating a web application, then your web pages may have all possibilities of being overwhelmed with a number of JavaScript files. Including large number of JavaScript files may slow down your web page. So its a good idea to load JavaScript dynamically to your web page, i.e load them only when these …
Category: Ruby On Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.
Permanent link to this article: https://blog.openshell.in/2011/06/loading-javascript-dynamically-using-jquery/
Jun 09
Guide to MySQL database Engine.
A MySQL database gives you a choice of database engines and an easy way to switch them. Default MySQL Engine would be enough for most of your application but in certain circumstances where the other available engines may be better suited to the task at hand. Choose your engine The number of database engines available …
Permanent link to this article: https://blog.openshell.in/2011/06/guide-to-mysql-database-engine/
May 05
Clearing Floats with Overflow using CSS
One of the common problems we face when coding with float based layouts is that the wrapper container doesn’t expand to the height of the child floating elements. The typical solution to fix this is by adding an element with clear float after the floating elements or adding a clearfix to the wrapper. But did …
Permanent link to this article: https://blog.openshell.in/2011/05/clearing-floats-with-overflow-using-css/
Apr 26
What is the difference between padding and margins?
Margins and padding can be confusing to the web designer. After all, in some ways, they seem like the same thing white space around an image or object. Padding is the space inside the border between the border and the actual image or cell contents. In the image, the padding is the yellow area around …
Permanent link to this article: https://blog.openshell.in/2011/04/what-is-the-difference-between-padding-and-margins/
Mar 18
Net::HTTP Raw Post Ruby Code
Net::HTTP is still a popular option though it doesn’t have the easiest API to remember. In order to Post & Access posted request object from the ruby script example is shown below: require “cgi” require “uri” require “net/http” #To Post data without form using RESTful Method url = URI.parse(“http://api.domain.com”) begin requestXml = “Johnjohn1234” http = …
Permanent link to this article: https://blog.openshell.in/2011/03/nethttp-raw-post-ruby-code/
Permanent link to this article: https://blog.openshell.in/2011/03/comment-multiple-lines-in-ruby/
Mar 17
Try Catch Finally block in Ruby
This the ruby code which is equivalent of a try/catch/finally block in other languages. #Try catch block Syntax begin somecode() rescue puts “Error #{$!}” ensure this_code_will_execute_always() end # Sample Code f = File.open(“testfile.txt”) begin # .. process rescue # .. handle error else puts “– no errors!” ensure f.close unless f.nil? end
Permanent link to this article: https://blog.openshell.in/2011/03/try-catch-finally-block-in-ruby/
Mar 17
REST methods form request in Ruby On Rails Client
In order to access RESTful web services from Ruby Client script using form request. The method net/http tries to connect over HTTP even of the uri is HTTPS. For HTTPS, You need to explicitly tell net/http that a secure connection should be used. REST client code as shown below: # Basic REST. # Most REST …
Permanent link to this article: https://blog.openshell.in/2011/03/rest-methods-form-request-in-ruby-on-rails-client/
Jan 28
Random Image Rotation in ROR
It’s pretty easy to accomplish random image rotation in ROR. This is a simple example of how it can be done, and of course there are ways to make it better (for example, this snippet will only rotate and display .jpg, .gif, and .png files). First, create a folder – let’s name it “rotate” – …
Permanent link to this article: https://blog.openshell.in/2011/01/random-image-rotation-in-ror/
Jan 27
How to Use External Font
Using External Font is very Easy 1.Download the font 2.If the Downloaded font is in ttf format convert it into eot format by a tool which you have to search and download or use this online convertor http://www.kirsle.net/wizards/ttf2eot.cgi 3.If the Downloaded file is in otf format convert it into ttf format and then convert …
Permanent link to this article: https://blog.openshell.in/2011/01/how-to-use-external-font/
Mar 17
Comment multiple lines in ruby
March 17, 2011
A multi-line comment begins with the =begin token and ends with the =end token. These tokens should start at the beginning of the line and be the only thing on the line. Anything between these two tokens is ignored by the Ruby interpreter. =begin Between =begin and =end, any number of lines may be written. …
Continue reading