Tuesday, December 27, 2011

Godaddy Goodbye

Baligena.com has transferred its domain name out of Godaddy.

Haha whats up with the discount until 12/29/11 Godaddy. I hate when companies act as if they're above their customers and when the shit hits the fan they come back apologizing, expecting everything to be alright. But its too late to apologize and if Godaddy is having a hard time understanding, below is a video that will help.



Baligena is now with namecheap.com because it's being mention alot from internet advocates such as techcrunch, hacker news and reddit. Also they are also apposed to SOPA and I their current slogan. Exercise your right. Yes, you're damn right I'm going to exercise it. They also have good prices.

I invite you to join me.
Click here for step by step instructions on how I did it.

Sunday, December 25, 2011

Stick to you commitment

You lose track of your purpose when you achieve little success. You cannot change your path even though success is coming. Once you made a commitment you stick to it. -Baligena

Saturday, December 24, 2011

View all MySQL tables in console

You may be wondering why phpmyadmin is showing more tables than the console or vise versa.

The reason is because one of them does not have the privilege to view them all. I was having a issue with seeing all my tables in the mysql console and this is what fixed it. I had to log in as the root. (I'm using a linux computer)

$ /opt/lampp/bin/mysql -u -p


If its the other way around which phpmyadmin doesn't show all the databases is because you have put the wrong user in phpmyadmin source code. Change phpmyadmin settings to fix this.

tags:
phpmyadmin database does not match console
mysql hidden tables console
not all databases are shown in console
show all databases

Access MySQL console in Linux using XAMPP

Open the terminal and type:

/opt/lampp/bin/mysql

Then press enter and the terminal will turn into the console.

To exit the mysql console type exit and press enter

Thursday, December 22, 2011

Programming Insomnia

Programming may give you Insomnia, it kept me up a couple of nights. Not because I had a deadline due the next morning but I couldn't stop thinking about coding. But this may be good insomnia. According to studies and also mentioned by VSauce when you dream about something difficult it's your subconscious trying to solve the problem. I had an experience once that I could not figure out a trigonometry problem but I went to sleep and woke up with the solution.

Monday, December 19, 2011

Listen to your users?

Steve Jobs from Apple made the statement that he doesn't conduct focus groups because customers don't know want they want because they haven't seen it yet. But there's a difference between being a visionary and not listening to users. When users were complaining about the IPhone dropping calls because the way it was held, Apple had to address that issue.

Another example is Todd Howard the directory of Elders Scroll Skyrim rated the best game of the year. Todd Howard personally goes on forums to read every comment to find out what players where complaining about until he hit mass success with Oblivion and couldn't read all of it anymore. He personally plays many successful and competitors games to find out what people are liking. He takes all this, new ideas and integrates into his game.

Friday, December 16, 2011

Don't fix what's not broken

Programs and websites are always trying to find the sweet spot between functionality and design, have those two things balanced. Now what sucks is having both of them close to perfection but changing it, like YouTube. YouTube new home page design is crap! How do you go from easy to use to hard. Yes it wasn't the prettiest design but the functionality was good. Functionality beats pretty any day.

The best program are self explanatory and use common sense. If a site needs a tutorial on how to use it, it's on the wrong path. WHY!?

Is it because they want their programmers to get busy like fast food restaurants make employers clean something that was already cleaned 1o minutes ago just for the the sake of being busy.

I understand change can have negative effect and it's necessary but when it jeopardizes usability. Someone needs to rethink their strategy, don't fix what's not broken.

Wednesday, December 14, 2011

You're being tracked

Be careful when you download torrents because it can be tracked. Checkout what you been tracked on youhavedownloaded.com

Monday, December 12, 2011

Turn PHP array into objects - stdClass

Want to access the contents of an array as simple as $array->firtParam

Here's how you do it

<?php
$person = array (
'firstname' => 'Richard',
'lastname' => 'Castera'
);

$p = (object) $person;
echo $p->firstname; // Will print 'Richard'
?>

Multi-dimensional array example

<?php
function arrayToObject($array) {
if(!is_array($array)) {
return $array;
}

$object = new stdClass();
if (is_array($array) && count($array) > 0) {
foreach ($array as $name=>$value) {
$name = strtolower(trim($name));
if (!empty($name)) {
$object->$name = arrayToObject($value);
}
}
return $object;
}
else {
return FALSE;
}
}
?>

<?php
$person = array (
'first' => array('name' => 'Richard')
);

$p = arrayToObject($person);
?>

<?php
// Now you can use $p like this:
echo $p->first->name; // Will print 'Richard'
?>
Reference

Wednesday, December 7, 2011

Concatenate Variables names in PHP

This is for when you want to have a variable to be part of a new variable nam

$var1 = 'category';
$var2 = 'one';
${$var1.$var2} = 'sometext';

//OR
$var1 = 'category';
$var2 = 'one';
$var = $var1.$var2;
$$var = 'sometext';

/*
this creates the var $categoryone
with with the value of 'sometext'
*/

Intergrate Zend into Codeigniter

Use Zend framework Libraries in CodeIgniter framework

click me

tags:
youtube API, GData

Monday, December 5, 2011

Do not develop in IE or Opera

Opera is suppose to be fast and conserve bandwidth because it downloads the page onto your computer but it sucks for developing!

The issue is the downloading makes the changes unaffected in development mode. I spent hours trying to fix the position of a background to later find out that I had delete the downloaded data for it to display correctly.

To delete the data go to Opera>Settings>Delete Private Data.

Now Internet Explorer does the same thing but it sucks in everything. I wish IE will disappear from the face of the earth.

Friday, December 2, 2011

960.gs Bookmarklet

Reference

The bookmarklet below will draw grids on your webpage

javascript:(function(){var%20jqLoader={go:function(){if(!(window.jQuery&&window.jQuery.fn.jquery=='1.3.2')){var%20s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js');s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s)}this.ok()},ok:function(){if(typeof(window.jQuery)!=='undefined'&&window.jQuery.fn.jquery=='1.3.2'){this.init()}else{setTimeout((function(){jqLoader.ok()}),100)}},init:function(){$.getScript('http://www.badlydrawntoy.com/static/960grid/js/jquery.960grid.bk-1.0.min.js',function(){$('body').addGrid(16)})}};jqLoader.go()})();


Tags:
grid