KEEP IN TOUCH

Join Newsletter

CALL NOW

Share with:


Recent Posts





Programming

Some experimentation with the text-overflow property. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"    "http://www.w3.org/TR/html4/strict.dtd"><html>  <body><div style="border: 1px solid red; max-width: 400px; overflow:hidden; text-overflow: ellipsis;"><nobr>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac libero nec est luctus aliquam. Nulla sodales, dolor a consectetur volutpat, elit mi convallis sem, at...

Read More

Reads a file line by line into an array my_stuff my_stuff = [] file = File.new("config/random_categories.txt", "r") while (line = file.gets) my_stuff << line.chop! end file.close my_stuff Pass file to block File.open("my_file.rb", "r") do |infile| while (line = infile.gets) puts "#{counter}: #{line}" counter = counter + 1 end end Read File with Exception Handling counter = 1 begin file = File.new("readfile.rb", "r") while (line...

Read More

Note that when setting the Rails environment you have to pass it differently in different cases. For rake, set RAILS_ENV= as part of the command line options. rake db:migrate RAILS_ENV=test But when running script/console, you just put the environment name after the "script/console": script/console test ...

Read More

WARNING: These instructions are for Facebook version 1 (not Facebooker2). Since last year, I have moved toward using a different gem for this due to Facebooker's lack of documentation. Working on a new blog post detailing that. So you want to write a Facebook app...

Read More