Category Archives: Programming Languages

Choose your programming language right here.

How to mock file upload with RSpec 3.0 ? [SOLVED]

One more note on RSpec 3.0, this time one useful function that mocks File Upload , saves file/archive content to memory so after it you can do whatever your soul wants with it. Test file/archive should exist in the file … Continue reading

Posted in open-source, Programming Languages, Rails, Rspec, Ruby | Tagged , , , , , , | Leave a comment

How to stub File.read in RSpec 3 [RAILS, TDD]?

  Recently, I have been doing whole bunch of spec rewriting from RSpec 2 to Rspec 3. As a result I have found that documentation is not that straightforward, and some cases you need to really spend time and figure … Continue reading

Posted in Programming Languages, Rails, Rspec | Tagged , , , , , | Leave a comment

How to stub an IP in Ruby on Rails, RSpec Version 3 ?

Often when you are writing unit tests, you want to mock your IP address. Some of the uses cases could be – you are checking if IP is within the certain range. For RSpec 2.x ¬†mocking ¬†IP would look like … Continue reading

Posted in Programming Languages | Tagged , , , , , , | Leave a comment

How to scaffold JavaScript Web Application in seconds using YEOMAN ? (example with Backbone Marionette)

Hey guys, Today I want to discuss an issue that I have been recently facing, and how to solve it. The issue is: How to set up a new JavaScript web app as quickly as possible and start developing, instead … Continue reading

Posted in Backbone.JS, Handlebars.JS, JavaScript, Marionette.JS, open-source, Programming Languages | Tagged , , , , , , , | 4 Comments

RAILS, HAML : How to put Checkbox and label on the same line, with translations

Hey guys! Today I have decided to share with you little secret, that can save you quite some time, while writing templates with HAML. While creating a form for one of the projects, I needed to put a checkbox within … Continue reading

Posted in Programming Languages, Rails | Tagged , , , , , | Leave a comment

How to make a contact form with Bootstrap 3 ? (JQuery/PHP/HTML5/JqBootstrapValidation)

Hey guys! Today we will talk about such essential feature for any website as contact form. Recently, while working on one of the projects, I had a pleasure combining couple of very nice tools (Bootstrap 3 + JQuery + jqBootstrapValidation), … Continue reading

Posted in Bootstrap, HTML5, JavaScript, Jquery, open-source, Programming Languages | Tagged , , , , , | 150 Comments

How to find if a number is power 2 ? (Bitwise and Iterative) [Python Script]

As I have promised, I continue answering your questions. One of the readers of myprogrammingblog.com wrote me an email asking How to find if a number is power 2 ? He also asked me to write a bitwise solution as … Continue reading

Posted in open-source, Programming Languages, Python, Useful Functions | Tagged , , , , | Leave a comment