My name is Harry Bailey. I am a web developer who lives in Didsbury Manchester. This site is what I use as my extended memory because sometimes mine doesn't do it's job too well.

Create Add Root FTP Account in cPanel

When you get a new hosting account you get an account user. These user details can be used to log into cPanel if you have it, but can also be used to connect via an ftp client to upload your sites files.

This always puts me on edge though. If someone gets your details they can’t just access your ftp but can also log in and make any changes that they want to your site.

For this reason I generally set up a new ftp account just to use for ftp access.

Until now I’ve never worked out how to access the root of a site with an ftp account. Generally I just accept access to the public_html folder and leave it at that. But today I finally worked out how to give an ftp account root access to a hosting accounts files.

Continue Reading… »

Posted by Harry at 4:30 pm on February 2nd, 2012. No comments... »
Categories: cPanel.

Animating Fade Of Twitter Bootstrap Buttons

I came across a curious issue today. You can’t select a period of time over which to fade out and fade in Twitter Bootstrap buttons.

If you apply jQuery fadeTo() or animate() they fade out and they fade in, but they do it in their own time.

This may be related to a css transition which is applied in the bootstrap css, I haven’t had a chance to look, but the workaround for me is to put the button in a span and fade the span in and out instead.

   <span><a class="#" class="btn small">Button Text</a></span>

Posted by Harry at 11:49 am on November 17th, 2011. No comments... »
Categories: Javascript, jQuery.

Add Random Hashes With Mysql

Adding a new column to a table which needs to contain a different random hash for each row?

Mysql can easily generate md5 strings and update all rows in the table for you

UPDATE thetable
SET thecolumn = MD5(RAND())
WHERE thecolumn IS NULL

Posted by Harry at 9:37 am on November 1st, 2011. No comments... »
Categories: MySQL.

CSS3 Element Wiggle With Keyframes

fetchit-21

This technique produces something similar to the wiggle you get on an iPhone when deleting items.

Be aware that keyframe animation is still very poor in Chrome and cases freezing and jumping if multiple items are animated at once.

The animation css below results in a hovered element rotating back and forth around it’s centre point. You can update the number of degrees and length of animation to change the appearance.

Just add this css and give your element the class ‘wiggler’ to implement

 
/* safari and chrome */
@-webkit-keyframes wiggle {
	0% {-webkit-transform:rotate(4deg);}
	50% {-webkit-transform:rotate(-4deg);}
	100% {-webkit-transform:rotate(4deg);}
}
 
/* firefox */
@-moz-keyframes wiggle {
	0% {-moz-transform:rotate(4deg);}
	50% {-moz-transform:rotate(-4deg);}
	100% {-moz-transform:rotate(4deg);}
}
 
/* anyone brave enough to implement the ideal method */
@keyframes wiggle {
	0% {transform:rotate(4deg);}
	50% {transform:rotate(-4deg);}
	100% {transform:rotate(4deg);}
}
 
.wiggler:hover {
	-webkit-animation: wiggle 0.5s infinite;
	-moz-animation: wiggle 0.5s infinite;
	animation: wiggle 0.5s infinite;
}

Posted by Harry at 11:45 am on September 29th, 2011. No comments... »
Categories: css, The Web.

Reordering Yii Results Without Another Select

fetchit-21

In case you weren’t aware, you can reorder the results you already have from a previous Yii call. For example…

 
$users = User::model()->findByPk(2);
$posts = $user->posts(array('order'=>' created Desc '));

There were just ordered our users posts by created date descending.

We can also do filtering…

 
$users = User::model()->findByPk(2);
$posts = $user->posts(array('condition'=>' status=1 '));

So now we only have active posts. We could also combine a condition and a status.

You can find out more here: www.yibrwork.com/doc/guide/1.1/en/database.arr#dynamic-relational-query-options

Posted by Harry at 1:13 pm on September 14th, 2011. No comments... »
Categories: PHP, Yii.

« Earlier Posts...
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.