Docker on Rails 7
Simple dev bootstrap rails with docker-compose. You’ll be up and running as quickly as 1..2…3!
Simple dev bootstrap rails with docker-compose. You’ll be up and running as quickly as 1..2…3!
Bootstrap your own jekyll blog with docker-compose
Allowing users to login with multiple authentication providers brings great benefits but also results in some annoying edge cases. For example, what happens ...
Here is serveral usefull source:
Installing(if not available) nano for mac/ubuntu
source
There is 4 ways to excute ruby method. Two of them can excute private method out of self class.
standard timeout require 'timeout' begin complete_results = Timeout.timeout(1) do sleep(2) end rescue Timeout::Error puts 'Print me something ...
problem as written some RSpec test for my rails 3.2 application and because I was annyoed by the Browser popping up ich tried to change from firefox to capyb...
Sometimes we want to simulate browser behavior. The situation can be test or automation script.
Just keep record of the procedure to deploy heroku install heroku heroku gem(deprecated) or toolbelt sudo aptitude install heroku-toolbelt #or for ubuntu wge...
RVM is a great command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. Thi...
Sometimes we need to generate a ‘n’ character random string.
Sometimes we would also need to generate x random numbers from n to m
While installing RVM on a mac, one of the major problems we face are due to missing Xcode. We usually get the error below:
Sometimes, we need to rake tasks that inserts a paticular user entered value into multiple databases.
Using Net module is the best and the eaiest ways to post data or make api calls to urls. Here’s an example
###strftime###
###MD5 digests### MD5 is a one-way hashing algorithm for creating digest “signatures” or checksums of strings. MD5 digests are 128 bit (16 byte) signatures. ...
Sometimes there are common sets of fields and id’s that we would like the api to filter before sending the details to the client. It would be great if we can...
Another common problem that rails developers face while developing web applications that connect to multiple external systems and api’s is configuring the th...
Extend vs. Include Modules are used for mixins, ruby’s way of handling muliple inheritance without the complications. There are two ways to mixin, either in...
There has been lots of questions on the comparison operators. So we yanked it for you..
There are two commands heavily used by developers for checking their pocesses in unix.
Setting up the rails mailer for development purposes is much easier. using the action mailer to configure the gmail services, is just a few commands and conf...
In Unix, what is screen, and how do I use it?
nohup is an unix command which prevents “hangups on logout” which also means that if you decide you need to logoff the from the session with the server, the ...
classes store methods
Add the following lines to make the rails console to use pry. make sure that
One of the common questions that we get about people coming from other programing languages is with the way switch cases work in ruby.
Add the following gems to the Gemfile and bundle install
One of the most common problems that we come across is when the programmer tries to setup the Mac OS X - name/hostname for the computer, since it takes up mo...
##Here are the steps to push a rails project to Heroku##
RVM is the Ruby environment manager. Here are some of the commonly used commands.
##Adding deligate method in the model##
##Including RSpec in your code:##
Download and install the latest mvim from
Following are some of the common git aliases, people use. Add them to ~/.bash_profile
SOURCE
When the bundling gems fail in Mac OS X, Download the latest GCC standalone file from the link below:
Learning Regular expressions require regular practice. Here are a few ways to practice:
Add configuration
what’s N+1 problem, how to solve the problem ```ruby clients = Client.limit(10) clients.each do |client| puts client.address.postcode end
just got error /Users/ken/.rvm/gems/ruby-1.9.3-p327/gems/rubypython-0.5.3/lib/rubypython/rubypyproxy.rb:198:in `method_missing’: ClassNotFound: no lexer f...
simple way to rescue and retry several tries = 0 begin # some routine rescue tries += 1 retry if tries <= 3 puts "no dice!" end #or 3.times do b...
capybara-webkit
There are many other Selenium gems out there, but this is the only official, maintained gem. If you’re looking for a slightly higher level API built on the s...
```ruby dynamic_name = “TestEval2”
```ruby class A
First, There are serveral revert situation: Local: # this will detach your HEAD, i.e. leave you with no branch checked out. git checkout 0d1d7fc32 git checko...
A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repea...
Starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
Here is some examples to help understand extend and include ```ruby module M_A def test puts true end end
Some frequently use:
```ruby get the submodule initially git submodule add ssh://bla submodule_dir git submodule init