Treason Uncloaked
!

by John Krueger

Up And Running With Rails 3.1, RVM, Git And Homebrew

Pregame

Do you have the newest xcode? Have you reinstalled it since you upgraded to Lion? Go grab it from the Mac AppStore, it's free. Your going to need to have that installed before you can continue..

Some of you may need to install git still. Lets get you going with homebrew to make that nice and easy. Paste this into your terminal:

/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

And Your installing homebrew. When it's done, open a new terminal tab and run:

brew install git

When this is done, open another terminal tab, and proceed to the main event.

Main Event

Let's make sure we start from the root directory. Copy and paste this command into your terminal:

cd

Now lets get rvm pulled down. Copy and paste this:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

This should take a min. When it's done run these 3 commands:

touch ~/.bash_profile

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

source .bash_profile

Now rvm is on your machine and loaded into your current terminal window. Epic. Now it's time to install ruby 1.9.2. Copy/paste this:

rvm install 1.9.2

This will take a few minutes. Sit back. Relax. Have a homebrew. When it's done, we can clone your repo onto your computer or start a new one. Navigate to the directory you want to put the repo. I have a dir called Rails.. It's up to you. If your using an existing repo, you'll need to do something like this:

git clone git@github.com:jtmkrueger/atriplex_project.git

Unless your starting a new project. In that case, skip the last step and keep following along.

We'll use the atriplex example for the rest of this post.

Ok, now navigate into the directory:

cd atriplex_project

And run these 2 commands:

touch .rvmrc

echo 'rvm 1.9.2@atriplex --create' > .rvmrc

Inserting the name you want for your gemset appropriately.

Great, now this might look a little strange. Back out of the directory:

cd ..

And then go back in:

cd atriplex_project

rvm should prompt you to approve your new gemset. Thats good. Say yes to everything. Now copy/paste these 2 things if your using the atriplex example:

gem install bundler

bundle install

And if your starting a new repo, run these commands:

 

gem install rails
rails new proj_name

 

This should take a little to run but... That's it! If you used the atriplex example, now you can run:

rails s thin

And if you started a new project you'll be able to run:

 

rails s

 

Whenever your in this directory and everything will work like a charm.

Point your browser at:

http://localhost:3000

And you're off to the races!

 

Sans CD/DVD drive

Having transitioned to a MacBook air, I have to say I don't miss the optical drive. Having a DVD player attached to the tv is all that's needed, and who buys software on CDs anymore? The machine is more than powerful for me. I think the real change was moving to solid state, where storage takes a back seat to speed. I'll never look back.

Failed the test of time

P66

And one day it will disappear.

Using Fondu And Font Squirrel To Convert Font Suitcase to Web Fonts

First, go get Fondu if you don't already have it. Now converting the font suitcase file is easy:

 

 

~$ fondu [suitcase file]

 

Make sure your in the right directory! You'll end up with a .ttf file, which you can use to display a font in some browsers (but not all!). Now go over to Font Squirrel and use the generator they have to get the other files and the css code to finish the job. Don't forget to set your paths right!  Notice the generator removes uppercase from the file names to play nice with linux.

Generating Random Numbers With Rails & MySQL

Having to do this today, I originally wrote my code like this

 

profiles = Profile.all.count
@profile = Profile.find(rand(profiles))

 

This counts on ruby, and makes 2 call to the database.

You can also do this in one call, like this if your using MySQL:

 

@profile = Profile.first(:order => "RAND()")

 

Much Cleaner.  

Invisibility Cloak Hides Objects Using Crystals

"... made the breakthrough using a natural crystal called calcite.

This transparent mineral boasts an optical property known as birefringence, or double-refraction. This means that when light enters the calcite, it splits into two rays of different polarizations traveling at different speeds and in different directions. This causes objects viewed through a clear piece of calcite to appear doubled."

So cool.  And Calcite is much cheaper than metamatreials which were the basis for previous invisibility cloaks.

Link To Full Article

Bing Recycling Google Search Results Proven By Google

We look forward to competing with genuinely new search algorithms out there—algorithms built on core innovation, and not on recycled search results from a competitor. So to all the users out there looking for the most authentic, relevant search results, we encourage you to come directly to Google. And to those who have asked what we want out of all this, the answer is simple: we'd like for this practice to stop.

I couldn't agree More.

 

Full Post on Official Google Blog:

http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-google-search.html

Great Scriptaculous Validation Library: livevalidation

Needed to have a simple & powerful client-side way to do some form validations today, and found this to be the best of those I tried.

http://livevalidation.com/documentation

Cold Fusion Reactor Reportedly Developed In Italy

"The scientists say that the reactor is well beyond the research phase; they plan to start shipping commercial devices within the next three months and start mass production by the end of 2011."

Full Story: http://bit.ly/gAhS01

Defense department 'tests' causing GPS blackouts in southern U.S.

Apparently no reason is being given as to why these blackouts are happening...

http://engt.co/fXOC0o