Saturday, July 30, 2011

jQuery $.ajax and $.post

Below is an ajax jQuery code that allow uses for POST. Communication between two pages.

$.post is a simpler version with less features than $.ajax. In the code below they are both configured to do the same concept.






mouseover me Type in box to see ajax

Wednesday, July 27, 2011

The Power of Persistence

Below is great video about survival persistence. This man went hunting after a deer and chased it for hours even when he couldn't see it until it gave up and collapsed. There was no force only perseverance. Persistence will be painful (he rubs his knee to relieve pain) but also pay off greatly.

Monday, July 25, 2011

How to redirect

Below are examples on how you can redirect your website. When someone visits your site and you want the traffic to go somewhere else. Choose your language, modify url and copy and paste.

Javascript:

<script>
location.replace("http://baligena.com") //or
location = "http://baligena.com";
</script>


PHP:

<?php
header( 'Location: http://www.baligena.com' ) ;
?>


HTML:

<meta HTTP-EQUIV='REFRESH' content='0'; url='http://www.baligena.com'>

Saturday, July 23, 2011

Debugging Elder Scrolls IV Oblivion

Below is a video of the making of Elder Scrolls IV Oblivion. Here gives an understanding on how debugging works in a group.

Wednesday, July 20, 2011

Working with .htaccess

What is .htaccess:
.htaccess (hypertext access) is the default name of a directory-level configuration file that allows for decentralized management of web server configuration. -Wikipedia

.htaccess is a way to modify the web server without editing the Master file.

In Apache the master file is called httpd.conf

How to create 404 and 403 pages:
404 pages appear when it doesn't exist (alternative to index.html in every directory on site) and 403 is a page exist but is forbidden to access.

In order for .htaccess to work you need to configure httpd.conf
AllowOveride must be set to All. See below. Remember its case sensitive. For some reason apache ships as "all" instead of a capitalized "All".

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

What to put in .htaccess:
ErrorDocument 404 /yourerrorpage.html
ErrorDocument 403 /yourerrorpage.html

# Options -Indexes is what allows the 403 error to work
Options -Indexes


If you don't want to use .htaccess you can simply put
ErrorDocument 404 http:yourerrorpage.html
ErrorDocument 403 /yourerrorpage.html

Warning: Make sure you always restart Apache when changes are made to the httpd.conf because the changes won't be taken into effect until you do

You must edit httpd.conf at the server, you can't use ftp unless it's not secured. It should be located at /etc/apache2/httpd.conf



How to rewrite URLs?
To manipulate your links like transfroming ?name=page&URL's into /friendly/cute/links
you must activate rewrite_module in Apache.

Left click on the wamp icon then hover over "Apache" and go to "Apache Modules" and click on rewrite_module (or mod_rewrite) so it has a check. (or 500 Internal Server Error may throw)

or open httpd.conf and uncomment(remove #) the line below
LoadModule rewrite_module modules/mod_rewrite.so

Wait for Apache to restart.

In .htaccess insert this code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) mvc/index.php/$1

------or-------

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

More information:
http://corz.org/serv/tricks/htaccess2.php

Good MVC clean URL video


_________________________________________________
Ubuntu sever 11.10
Now the mod rewrite is a little different in the Ubuntu server. You have to create a "rewrite.load" symlink from /etc/apache2/mods-available to /etc/apache2/mods-enabled by running:
$ sudo a2enmod rewrite
then edit:
$ sudo nano /etc/apache2/sites-available/default
and make line 11 to AllowOverride None to AllowOverride All, see snippet below

<Directory /home/marko/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>


then restart apache:
$ sudo service apache2 restart

reference: http://www.techytalk.info/enable-apache-mod_rewrite-on-ubuntu-linux/


description: mod_rewrite wamp, .htaccess issue (500 - Internal Server Error), .htaccess apache mvc configuration 500, redirecting and rewriting

Monday, July 18, 2011

Debugging for Internet Explorer

I posted earlier that I will stop going out of my way to make a site compatible with Internet Explore. However that is not a choice for everyone and if you have a client who is out of touch they might want comparability with IE so here is a link to My Debugbar IE tester. Its a free software that allow you to test your website on all IE version without having to download IE.


Seen at Slice and Dice that PSD second video towards the end.

Sunday, July 17, 2011

Reset CSS

Reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on

Paste code below in stylesheet and delete the elements you do no need

/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

Saturday, July 16, 2011

Creating columns in website

This tutorial shows how to create columns in website and prevents the div from wrapping when the browser is minimized






Syntax Source:
<html>
<head>
<style>
#main {
width: 600px;
}

.col {
float: left;
border: 1px solid red;
padding: 10px;
margin: 0px 20px 0px 0px;
}
</style>
</head>
<body>

<h1>Columns</h1>
<div id="main">
<div class="col">
<h3>Title</h3>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
</div>
<div class="col">
<h3>Title</h3>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
</div> <div class="col">
<h3>Title</h3>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
<p>asdfasdfxiv</p>
</div>
</div>
</body>
</html>


Cancel an eBay bid

Buyer wanting to cancel
fill out the Bid Retractions form.
Warning!! Retraction request are not accepted if it was placed more than an hour ago and is for an auction that ends in 12 hours or less.

Seller wanting to cancel
fill out the cancel bid form

Wednesday, July 13, 2011

No security

Be careful when you trust your job. I had a couple of bad experiences at a job. You never know if your boss is going to fire you, lay you off, go out of business, or disapprove you work history. I always try to improve my skill. The main reason is that if I lose my job at least I can fall back on something. Whatever skill you acquire at your job rarely will be transferred to another. Your going to have to start from the bottom again. I worked at many places where the supervisor only watches people and surf the internet for a living. It makes me sad to know that they're screwed if they lose their job. Be like the ant the prepares for the winter, do this in all areas of life.

Monday, July 11, 2011

Finding the Solution

Sometimes finding a solution to a problem is best not thinking.

When I was trying to solve a javascript loop problem I tried so hard to figure it out but later got distracted by someone speaking to me and when I came back the answer came to me in a split second.

When I was building the FQ shows I couldn't figure out how to get the dreamweaver snippet interact with php. I went to the movies to watch Tron and when I came back the answer came to me instantly.

Sunday, July 10, 2011

Tutorial: Wordpress Beginner Series

ThemeForest.com has a great series of tutorial if your trying to learn wordpress.

Click Me

Wednesday, July 6, 2011

What to say to haters

Don't let someone discourage you in achieving your goal.
Fill in the blanks:

I was _________ before you came and I will be _________ after you leave.

Sunday, July 3, 2011

No off Season

When I wrestled in high school what separated the best wrestlers from the crap wrestlers was there was no such thing as an off season. We trained all year round.

Part of the season was training, competing, testing your skills and winning awards and the second part was just training. The first part was the funnest, most rewarding, shortest and the in season.

After the season ended more than a third of the team stopped training and came back when the "season" started back again. All those who did this eventually quit or achieved mediocre success. Whats great about an individual sport is that all the work you put in is exposed. There's no one to blame but yourself.

Whats separates the champion from the loser is sometimes "showing up". Working at your goal not only when you feel like it but when you don't, in season and out of season. Remember there's no such thing as an off season to the successful.

Saturday, July 2, 2011

Learning Git

Git allows you to work on your code with the peace of mind that everything you do is reversible. It makes it easy to experiment with new ideas in a project and not worry about breaking anything.

Resources:
nettus.com
gitcasts.com
Git Magic

Friday, July 1, 2011

True Underdog

An underdog is a person or group who is popularly expected to lose.