Blog Archives

Ruby NET::HTTP requests library cheatsheet

Nice cheat sheet resource of Ruby HTTP requests is published on rubyinside.com. Since the comments are disabled I decided to add one note here: When using uri = URI.parse(“http://google.com/”) it is good practice to encode the url with URI.encode(“http://google.com”, “[]“)

Tagged with: ,
Posted in Ruby

Tools for cleaning your CSS files

Few useful tools for analyzing unused CSS and cleaning it. I will sure forget later, so I am adding the links in order to have them: https://github.com/zmoazeni/csscss https://github.com/geuis/helium-css http://www.cleancss.com/ http://www.makeuseof.com/dir/csssuperscrub-make-css-cleaner/

Tagged with: ,
Posted in CSS

Upgrade Postgres minor version on Ubuntu

I am not a DBA, but recently I have to upgrade Postrges minor version with a security update. This is not either a tutorial or some best practice, but some small snippet of the command you will need, before doing

Tagged with: ,
Posted in Databases, Postgres

Use Railroady to generate UML diagrams for your project’s controllers and models

Introduction Railroady is a Railroad fork, a Ruby On Rails diagram generator for models and controllers. If you are using Rails 2.3.x with Ruby 1.8.7 checkout Railroad gem. Otherwise use Railroady with Rails 3.x. Both gems are using graphviz open

Tagged with: , ,
Posted in Ruby On Rails

Connecting Matlab to Postgres database

Assumptions My primary focus is not on Matlab, but I used it for a while in the Uni. I have to support connecting Matlab installed on Windows machine with Postgres 9.2 database. I used the Matlab command window, so this

Tagged with: ,
Posted in Postgres

cannot load such file — mkmf

Installing bcrypt-ruby give this error: Installing bcrypt-ruby (3.0.1) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.     /usr/bin/ruby1.9.1 extconf.rb /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require’: cannot load such file — mkmf (LoadError)     from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require’     from extconf.rb:36:in `<main>’ This has a dependency

Tagged with: , ,
Posted in Ruby On Rails

Invalid date format in gemspecs

Spotted several lines with invalid date format when installing a gem invalid date format in specification: “2011-08-25 00:00:00.000000000Z” While one can go through the gems specs and fix the format, one can just install rubygems-update sudo gem install rubygems-update Then

Tagged with: , ,
Posted in Ruby On Rails

Error installing json and Failed to build gem native extension – Windows specific

After updating Windows bundle install and gem install json gives the following error ERROR: Error installing json. ERROR: Failed to build gem native extension. Found solution here. In my case it happen after Windows update and “Scenario B” worked for

Tagged with: ,
Posted in Ruby On Rails

Convert column to geometry in Postgres

I noticed a column in Postgres which is varchar, but has geo information and should be geometry. Here are short steps to do in order to convert the data in geometry instead of varchar. 1. Rename the column to the_geom_1

Tagged with: ,
Posted in Postgres

Sync Total Commander pane navigation

A quick shortcut command for synchronizing Total Commander panes navigation. Copy / paste it in the command line to turn on / off. cm_SyncChangeDir

Tagged with: ,
Posted in Articles
Sites
Categories
Archives