The Construction of an Explorer

Adding rspec to your rails app

September 22, 2010
Comments Off
group :development do
gem ‘rspec-rails’, ’2.0.0.beta.18′
end
group :test do
gem ‘rspec’, ’2.0.0.beta.18′
end
save gemfile
do “bundle install” in terminal or command line
to use rspec instead of rails default test::unit you have to:
rails generate rspec:install
if you are using git you can remove the tests for views and helpers
git rm -r spec/helpers
git rm -r spec/views
rspec spec/:
rspec runs the program and spec/ runs the particular directory.
rspec results come green and red.  green means the test passes while red means it fails.
TTD writes a failing test first to make sure we are testing for the right thing.
describe “GET ‘about’” do
it “should be successful” do
get ‘about’
response.should be_success
end
end
the first line will be the REST function for the about page.  the 2nd line will be what is spit back out.  the third line will get that page, and the 4th line is the method performed in the test.
“render_views” must be added to test the views along with the controller.
this test should fail because there is no about page.

Deploy app through Heroku

September 12, 2010
Comments Off

Once again, this is more for my benefit than anything else since I keep forgetting how to upload the app through the command line.

*Make sure you have the heroku gem.  If not, I suggest you do that through the command line.

$ heroku create

$ git push heroku master   (this is assuming you have already pushed your project up to github.com

$ heroku rake db:migrate  (if you already have models created in for your database, then this will merge whatever’s in it)

if you have data that would also like to upload then:

(sudo) install gem taps

$  heroku db:push


Pushing project to github (Ruby on Rails)

September 10, 2010
Comments Off

This is mainly for me, since I cant seem to memorize this process.

After creating the gemfile, go ahead do the bundle install in the command line, or terminal.  Then:

git init

git add .

git commit -m “message”

git remote add origin git@github.com:git_username/app_name.git

git push origin master



Assignment 8 Viral Marketing

June 28, 2010
Comments Off

What we have here is the landing page for Laptops For All.  It contains the potentially viral video along with calls to action from the top to bottom.  The main call to action is the “design your own lap top” button.  This button links directly to the main site, where the potential customers can play with the create-a-laptop feature.  This landing page is created to entice and pique the curiosity of male customers who are looking for a “unique” gift  to give to the special women in their lives.  Because the laptops cost a considerable amount of money, we are not expecting a sale right away, but only to present potential customers with an alternate option for their gifts.

The video is designed to show the visitor what may happen if they do present the right person a unique gift of a laptop such as ours.

This landing page will continue to be tested and the clicks will be recorded to keep an accurate number of new visitors from this landing page.


Ruby Syntax

June 24, 2010
Comments Off
In ruby I can do this.
first_name = Phanousit
last_name = Syhakhom
full_name = first_name+ ‘ ‘+lastname     #or
full_name = first_name + ‘ ‘ + lastname  # notice the spaces between the variable and +?
Both will produce the same result.
Ruby itself is a dynamically type language.  Which means the variable does not need to be set anywhere.  You can call it whenever you like and it will be that variable.

Assignment 5 – 6 for Viral Marketing

June 21, 2010
Comments Off

This is my viral video for Viral Marketing.  


Posted in Uncategorized

Viral Marketing Assignment 3

June 14, 2010
Comments Off

This is the official song for Fifa’s World Cup 2010.  It is no doubt inspired by the country in which it is being hosted.  I am not quite sure if any other major tournaments have even been held on African soil, but for sure, this is the first Wold Cup held on this continent.  It is being host by South Africa, which has had quite a tumultuous history during its formation.  The song itself is made to uplift the spirits, and bring together the world for this major sporting event.


Posted in Uncategorized

Using PHP for forms

February 26, 2010
Comments Off

One of the first and I dare say, most simple things I’ve learned so far is to use PHP for grabbing information from basic forms.

You can start with a simple form built in HTML.

From there you would need to change the form action to the PHP document you are using to grab the user information. For example “process.php”. Make sure you remember the name in which you give the form boxes, for example “name=”name”".

<html>
<head>
<title> Forms </title>
</head>
<body>
<form action=”process.php” method=”post”>
Username: <input type=”text” name=”username” value=”" />
<br />
Password: <input type=”password” name=”password” value=”" />
<br />
<input type=”submit” name=”submit” value=”Submit” />
</form>
</body>
</html>

In the process.php page, you will need to to use the super global $_POST to grab the info from the form. Your variables should look something like this:

$name = $_POST['name'];

<?php

$username = $_POST['username'];

$password = $_POST['password'];

echo “{$username}: {$password}”;

?>

When you try it out, it should return the inputs that you put in the field. Thats basically it. I hope it helps!


Journey Into PHP…

January 27, 2010
2 Comments

My journey into PHP has been anything but easy. I was amazed by what what the language could do, and when the clients started asking for more dynamic pages, I had to take it upon myself to learn it. My intro into PHP has been anything but easy. Unlike HTML and CSS, it took more than a text editor to get the job done. Before you even start, you need to download the latest version of PHP (which right now is 5.3, I believe www.php.net), the Apache server, and the MYSQL data base. Fortunately I have a Macbook with OS 10.5, so PHP and Apache come built into the operating system. After reading countless articles on the Internet and reading books, I stumbled upon lynda.com, and it has helped me so much. I do not have a problem reading through books and learning, but for some reason setting my computer to code in PHP was so confusing. Lynda.com had a video tutorial and after an evening of installing everything I needed, I was coding in basic PHP by the end of the night.


Posted in Web Development
Tags: , ,

First post from phone!

December 23, 2009
Comments Off

Isn’t technology wonderful? I know I haven’t been updating regularly, and its a shame on me, but more to for sure.


Posted in Uncategorized
Tags:
Next Page »
Follow

Get every new post delivered to your Inbox.