<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>EG Studio</title> <atom:link href="http://www.egstudio.biz/feed/" rel="self" type="application/rss+xml" /><link>http://www.egstudio.biz</link> <description>Creative web agency from Israel</description> <lastBuildDate>Thu, 24 Nov 2011 08:02:45 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Gartner IOM Summit Preparations</title><link>http://www.egstudio.biz/gartner-iom-summit-preperations/</link> <comments>http://www.egstudio.biz/gartner-iom-summit-preperations/#comments</comments> <pubDate>Thu, 16 Jun 2011 14:34:18 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://www.egstudio.biz/?p=842</guid> <description><![CDATA[Noliosoft have recently attended Gartner's annual IOM Summit. In effort to create an impact they needed us to create a huge bundle of materials in a very short while. Here is what we did:]]></description> <content:encoded><![CDATA[<p>Noliosoft have recently attended <a
href="http://www.gartner.com/technology/summits/na/it-operations/" target="_blank">Gartner&#8217;s annual IOM Summit</a>. In effort to make an impact they needed us to create a huge bundle of materials in a very short period of time. Here is what we did:</p><h2>Room Drop Flyer</h2><p>This is a two-sided flyer that illustrates the problem Nolio are trying to solve. The packages move through the production line from the agile developer to the automated QA robot and then get accumulated at IT operations that can&#8217;t keep up. The backside of the flyer invites people to the Nolio booth for a chance to win a free iPad2.</p><p><a
href="http://www.egstudio.biz/wp-content/uploads/2011/06/original.jpg" target="_blank"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/06/original.jpg" alt="" title="original" width="500" height="705" class="alignleft size-full wp-image-845" /></a></p><h2>Summit Feed</h2><p>The summit feed is basically a minisite that contains a description of the summit and a Twitter feed from the summit.<br
/> <a
href="http://www.egstudio.biz/wp-content/uploads/2011/06/summit-feed.jpg" target="_blank"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/06/summit-feed.jpg" alt="" title="summit-feed" width="500" height="384" class="alignleft size-full wp-image-847" /></a></p><h2>Poster &amp; Sign</h2><p>Here are an additional poster and sign we designed. The poster for the booth has clean typography with a quote from Gartner, the poster was printed on huge 56 inch paper and placed as illustrated below.<br
/> <a
href="http://www.egstudio.biz/wp-content/uploads/2011/06/large-sign.jpg" target="_blank"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/06/large-sign.jpg" alt="" title="large-sign" width="500" height="382" class="alignleft size-full wp-image-844" /></a></p><p>The sign basically invites people to the booth.<br
/> <a
href="http://www.egstudio.biz/wp-content/uploads/2011/06/small-sign.jpg" target="_blank"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/06/small-sign.jpg" alt="" title="small-sign" width="500" height="704" class="alignleft size-full wp-image-846" /></a></p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/gartner-iom-summit-preperations/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Setting Up a Fully Featured LAMP Server &#8211; Part Two</title><link>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-two/</link> <comments>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-two/#comments</comments> <pubDate>Tue, 07 Jun 2011 09:30:52 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://www.egstudio.biz/?p=797</guid> <description><![CDATA[Following our first post on 'how to set-up a LAMP server on Rackspace', this post will help us deploy a proper development environment with SVN and Webmin, examine security best practices and general maintenance, so let's get right to it.]]></description> <content:encoded><![CDATA[<p>Following our first post on <a
href="http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-1/">how to set-up a LAMP server</a>, this post will help us deploy a proper development environment with SVN and Webmin, examine security best practices and general maintenance, so let&#8217;s get right to it.</p><h2>Installing Subversion</h2><p>Subversion allows you to manage code, collaborate and deploy versions safely, this not required but very recommended. The installation is fairly easy:</p><p><code>apt-get install subversion</code></p><p>We would also recommend using a remote repository like <a
href="http://beanstalkapp.com/">Beanstalk</a> and manage your deployments better.</p><h2>Installing Webmin</h2><p>Webmin is a nice open source control panel for your server, very similar in function to <strong>cPanel</strong> or <strong>Plesk</strong>. The installation is pretty straight forward:</p><p><code>dpkg --install webmin_1.550_all.deb</code></p><p>The install will be done automatically to /usr/share/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL <strong>http://ip.address:10000/</strong>.</p><p>If you encounter dependency issues, just type in the following:</p><p><code>apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions</code></p><p>If you haven&#8217;t installed the <strong>dpkg</strong> package by now, just type in:</p><p><code>apt-get install dpkg</code></p><p>And then repeat the process.</p><h2>ClamAV &#8211; Antivirus</h2><p>Web servers are often vulnerable to attacks from viruses, trojans and worms. It important to check your server regularly and often. ClamAV is a free antivirus available for Linux. Just type the following to install ClamAV:</p><p><code>apt-get install clamav</code></p><p>To scan files:</p><p><code>clamscan -R /folder_name</code></p><p>To update virus database:</p><p><code>freshclam</code></p><h2>IP Tables Firewall</h2><p>IP Tables is a pretty basic firewall software that allows you block off ports. To install IP Tables, just type:</p><p><code>apt-get install iptables</code></p><h3>How to use IP Tables</h3><p>First, if you wish, create a whitelist (IP passes through firewall) or blacklist (packets from IP always dropped):</p><p><code>nano /usr/local/etc/whitelist.txt</code></p><p>And/Or:</p><p><code>nano /usr/local/etc/blacklist.txt</code></p><p>Add to these files IP addresses that you&#8217;d like to accept or block, one IP address per line.</p><p><strong>Create firewall.sh Script</strong><br
/> Then put the following in /etc/init.d/firewall.sh, and edit to fit your needs:</p><pre class="brush: bash; title: ;">
#!/bin/sh
#
## Quick n Dirty Firewall
#
## List Locations
#
WHITELIST=/usr/local/etc/whitelist.txt
BLACKLIST=/usr/local/etc/blacklist.txt
#
## Specify ports you wish to use.
#
ALLOWED=&quot;22 25 53 80 443 465 587 993&quot;
#
## Specify where IP Tables is located
#
IPTABLES=/sbin/iptables
#
## Clear current rules
#
$IPTABLES -F
echo 'Clearing Tables F'
$IPTABLES -X
echo 'Clearing Tables X'
$IPTABLES -Z
echo 'Clearing Tables Z'
echo 'Allowing Localhost'
#Allow localhost.
$IPTABLES -A INPUT -t filter -s 127.0.0.1 -j ACCEPT
#
## Whitelist
#
for x in `grep -v ^# $WHITELIST | awk '{print $1}'`; do
        echo &quot;Permitting $x...&quot;
        $IPTABLES -A INPUT -t filter -s $x -j ACCEPT
done
#
## Blacklist
#
for x in `grep -v ^# $BLACKLIST | awk '{print $1}'`; do
        echo &quot;Denying $x...&quot;
        $IPTABLES -A INPUT -t filter -s $x -j DROP
done
#
## Permitted Ports
#
for port in $ALLOWED; do
        echo &quot;Accepting port TCP $port...&quot;
        $IPTABLES -A INPUT -t filter -p tcp --dport $port -j ACCEPT
done
for port in $ALLOWED; do
        echo &quot;Accepting port UDP $port...&quot;
        $IPTABLES -A INPUT -t filter -p udp --dport $port -j ACCEPT
done
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -p udp -j DROP
$IPTABLES -A INPUT -p tcp --syn -j DROP
</pre><p>Give the script proper permissions:</p><p><code>chmod 700 /etc/init.d/firewall.sh</code></p><p>And start your firewall:</p><p><code>/etc/init.d/firewall.sh</code></p><h2>General Security and Maintenance Tips</h2><h3>Daily Database Backups</h3><p>Use <strong>Webmin scheduled cron jobs</strong> in order to backup your DB on a daily basis:</p><p><code>mysqldump --opt --user=USER --password=PASSWORD --databases DBNAME --default-character-set=utf8 | gzip > /var/backups/db-`date +\%Y-\%m-\%d`.sql.gz</code></p><p>Just replace <strong>USER</strong> with username, <strong>PASSWORD</strong> with password and <strong>DBNAME</strong> with the database you want to backup. You can also <em>&#8211;all-databases</em> instead of <em>DBNAME</em> to backup your entire database. If your backups take too much space, you may want to consider a script to erase old backups.</p><h3>Bind MySQL to Local Connections Only</h3><p>Though sometimes necessary, enabling remote connections to your database is not recommended. If you do enable remote connections to your database, make sure they are made only via trusted IP addresses.</p><h3>Restrict SSH Connections</h3><p>SSH connections enable command line access to your server thus an insecure SSH port (22 by default) may pose a huge security risk. Here are a few pointers regarding SSH connections:</p><ol><li>Disable root log-in to your server. Create another user with root privileges and use it to log-in, this way you&#8217;ll still need to enter your password before certain commands.</li><li>If possible, restrict SSH log-in to trusted IP addresses:</li></ol><p><code>iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 --source [accepted ip address here] -j ACCEPT</code></p><h3>Check For Viruses Daily</h3><p>Use <strong>Webmin</strong> to setup a daily virus check on your <strong>/var/www</strong> directory with <strong>ClamAV</strong>. Also, make sure that your virus DB is updated</p><h3>Install Fail2Ban</h3><p>Fail2ban is a simple script that blocks users for 10 minutes after more than 5 failed log-in attempts.</p><p><code>apt-get install fail2ban</code></p><h2>Summary</h2><p>This concludes our setup, it&#8217;s important to mention that this process has never been tried from start to end but a reconstruction of a previous setup. So if you encounter problems, have any suggestions please leave us a comment and share your thoughts with us.</p><p>One last thing, I&#8217;d like to give a big thanks to our friends at <a
href="http://forrst.com" target="_blank">Forrst</a> who helped us with some great advice on the security section.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-two/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Setting Up a Fully Featured LAMP Server – Part One</title><link>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-1/</link> <comments>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-1/#comments</comments> <pubDate>Mon, 30 May 2011 09:00:56 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://www.egstudio.biz/?p=776</guid> <description><![CDATA[We've decided to write this post after a long and tedious process of installing a fully featured web server for one of our projects. This post, the first in a series of 2, will walk you through the entire process of creating a working and stable application development environment on Rackspace cloud servers.]]></description> <content:encoded><![CDATA[<p><img
src="http://www.egstudio.biz/wp-content/uploads/2011/05/iStock_000006820712Small-300x205.jpg" alt="" title="Data storage concept" width="300" height="205" class="alignleft size-medium wp-image-811" /></p><p>We&#8217;ve decided to write this post after a long and tedious process of installing a fully featured web server for one of our projects. This post, the first in a series of 2, will walk you through the entire process of creating a working and stable web server on Rackspace cloud servers. First, lets examine the final setup:</p><ol><li>Linux Ubuntu 10.04</li><li>Apache2 &#8211; Web server</li><li>PHP5 &#8211; PHP scripting language</li><li>MySQL 5 &#8211; MySQL database server</li><li>PhpMyAdmin &#8211; Web-based database admin software</li><li>Postfix &#8211; MTA (Mail Transfer Agent)</li><li>ClamAV &#8211; Antivirus</li><li>Webmin &#8211; Open source server control panel</li><li>Subversion</li></ol><p>Before we dive right in, let&#8217;s update the necessary packages for Debian with:</p><p><code>apt-get install update</code></p><h2>Installing Apache2 + PHP5</h2><p>Apache and PHP go together like pees and carrots. They are surprisingly easy to set-up, just type:</p><p><code>apt-get install apache2 php5 libapache2-mod-php5</code></p><p>After the installation is done, your web folder will be: <strong>/var/www</strong>. To check weather PHP is installed, just create a <strong>.php</strong> file in this folder with:</p><p><code>phpinfo();</code></p><p>Point your browser to your server&#8217;s IP address + file name: <strong>http://ip.address/your.filename</strong></p><h3>Enabling extra modules for PHP</h3><p>Sometimes your application will require extra functions the standard PHP5 package might not have. Here are a few common and useful packages:</p><ol><li><strong>php5-gd</strong> &#8211; GD Library, useful for image manipulation</li><li><strong>php5-cli</strong> &#8211; Command line PHP, useful for Cron tasks</li></ol><p>To install either one, you can type:</p><p><code>apt-get install <strong>package-name</strong></code></p><h3>Mod Rewrite with .htaccess</h3><p>Enabling <strong>mod_rewrite</strong> in Apache allows you to use clean URL&#8217;s. Use the following command to enable mod rewrite:</p><p><code>a2enmod rewrite</code></p><p>After enabling mod_rewrite, make sure Apache can use it by editing the following file:</p><p><code>nano /etc/apache2/sites-enabled/default</code></p><p>Find the <strong>AllowOverride</strong> directive and change it from <em>None</em> to <em>All</em>. After making these changes, restart Apache.</p><p><code>/etc/init.d/apache2 restart</code></p><p>Note: In order to use mod_rewrite, just upload your <strong>.htaccess</strong> and give it <strong>644</strong> permissions.</p><h2>Installing MySQL 5 database server</h2><p>MySQL is a crucial part of almost any web application. In order to install MySQL, your server must have at least 256 RAM, otherwise you may get a &#8220;<strong>cannot connect to mysql.sock</strong>&#8221; error. Let&#8217;s go ahead and install MySQL:</p><p><code>apt-get install mysql-server mysql-client php5-mysql</code></p><p>The MySQL configuration file is located at: <strong>/etc/mysql/my.cnf</strong>.</p><h3>Installing PhpMyAdmin</h3><p>PhpMyAdmin is web-based management software for MySQL. In order to install PhpMyAdmin just type in:</p><p><code>apt-get install phpmyadmin</code></p><p>The PhpMyAdmin configuration file is located at: <strong>/etc/phpmyadmin</strong> folder. Now restart Apache and point your browser to: <strong>http://your.ip/phpmyadmin</strong>.</p><h2>Installing Postfix</h2><p>Postfix is widely considered a better replacement for Sendmail. Let&#8217;s examine how to set-up Postfix only as a mail transfer agent (MTA) thus allowing your application to send mail via PHP. First, make sure your domain has valid MX records set-up as: <strong>mail.your.domain</strong>. Then, type in the following line:</p><p><code>apt-get install postfix</code></p><p>You will need to install also the <strong>mailutils</strong> package:</p><p><code>apt-get install mailutils</code></p><p>Your Postfix configuration file will be located at: <strong>/etc/postfix/main.cf</strong>. Make sure the <strong>myorigin</strong> parameter in the configuration file is set like this:</p><p><code>myorigin = mail.server</code></p><p>Check if Postfix is active.</p><p><code>postfix status</code></p><p>If not, activate it:</p><p><code>postfix start</code></p><p>Make sure port 25 is not blocked and that Postfix is listening at that port, you can use:</p><p><code>telnet localhost 25</code></p><p>Or</p><p><code>netstat -pant</code></p><p>To check general port activity. Note that sometimes after installing Postfix, your server will require a reboot before being able to send mail, especially if you&#8217;ve tried installing other MTA&#8217;s.</p><h2>Installing VSFTP</h2><p> Installing an FTP server will allow you to upload files more easily to you web server. VSFTP is a simple, secure and fast FTP server. Let&#8217;s examine how to install it correctly:</p><p><code>apt-get install vsftpd</code></p><p>Configuration file is located at: <strong>/etc/vsftpd.conf</strong>. Change the following settings in <strong>/etc/vsftpd.conf</strong> so that you allow local users and allow write using ftp.</p><p><code>local_enable=YES <strong>and</strong> write_enable=YES</code></p><p>Before you connect using ftp client, you will need to create local users and group. <strong>Do not upload files using root</strong>. CD to <strong>/home/<user></strong> and create a symbolic link to <strong>/var/www</strong> as this is the public HTML folder.</p><p><code>ln -s /var/www www</code></p><p>Change ownership /var/www to user:</p><p><code>chown -R <user> /var/www</code></p><p>Change to 755 permissions:</p><p><code>chmod -R 755 /var/www</code></p><p>Now you can connect to FTP and upload files. Once you upload all necessary files in the public HTML folder, make sure all the files have 755 permission as otherwise you will get permission denied/forbidden error from Apache.</p><h2>End of part 1</h2><p>In this post we&#8217;ve pretty much covered everything you need to do in order to get your web server going. The next post will cover how to setup your domains, development environment and general security suggestions. If you tried using this post to setup your server, let us know how it went.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/setting-up-a-fully-featured-lamp-server-part-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ajax Modal Window Plug-in For jQuery</title><link>http://www.egstudio.biz/ajax-modal-window-plug-in-for-jquery/</link> <comments>http://www.egstudio.biz/ajax-modal-window-plug-in-for-jquery/#comments</comments> <pubDate>Sun, 22 May 2011 11:51:25 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://10.0.0.145/egstudio/?p=466</guid> <description><![CDATA[Using jQuery to create modal windows is great, but often we see a lot of plug-ins that are simply too heavy or complicated. Here is a bit of code we created over time and recently converted in to a plug-in. We use it when we want to load external information without any other dependencies.]]></description> <content:encoded><![CDATA[<p>Using jQuery to create modal windows is great, but often we see a lot of plug-ins that are simply too heavy or complicated. Here is a bit of code we created over time and recently converted in to a plug-in. We use it when we want to load external information without any other dependencies.</p><h2>The Code</h2><p>The plug-in code basically uses the jQuery.load() function to load external information. Once activated the plug-in will load the link&#8217;s content to a designated modal window. This technique allows for graceful degradation and is used as best practice for loading external content. The actual modal window is actually very simple and can be designed any way you like, we avoided adding elements automatically to allow maximum flexibility.</p><h2>Basic Usage</h2><p>The usage is pretty straight forward, just download <a
href="/downloads/jquery.modal.js" target="_blank">jquery.modal.js</a> or <a
href="/downloads/jquery.modal.min.js" target="_blank">jquery.modal.min.js</a>, plug them in and follow these instructions:</p><h3>The JavaScript</h3><pre class="brush: jscript; title: ;">
$('a[rel=&quot;modal&quot;]').simplemodal();
</pre><h3>The HTML</h3><pre class="brush: xml; title: ;">
&lt;a href=&quot;your-link-here.php&quot; rel=&quot;modal&quot;&gt;Click me&lt;/a&gt;
</pre><h3>The CSS</h3><pre class="brush: css; title: ;">
/* Loaded from the plug-in */
#simplemodal { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url(x.png) repeat top left; z-index: 1000; text-align: center; display: none; }
/* Loaded from the link */
#modal { position: relative; width: 680px; margin: 5% auto; background: #000; padding: 1.5em; text-align: left; }
</pre><h3>The PHP</h3><pre class="brush: php; title: ;">
/**
 * $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'
 * This is used in case the page is accessed normally
 */
&lt;?php if($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'){ ?&gt;
&lt;!DOCTYPE html&gt;
&lt;html dir=&quot;ltr&quot; lang=&quot;en-US&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot; /&gt;
&lt;title&gt;Example&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php } ?&gt;
&lt;div id=&quot;modal&quot;&gt;
	My modal window
&lt;/div&gt;
&lt;?php if($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'){ ?&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php } ?&gt;
</pre><h2>Your turn to share</h2><p>Let us know if this code has been helpful and what&#8217;s your intake on modal windows.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/ajax-modal-window-plug-in-for-jquery/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Easy Parallax with jQuery</title><link>http://www.egstudio.biz/easy-parallax-with-jquery/</link> <comments>http://www.egstudio.biz/easy-parallax-with-jquery/#comments</comments> <pubDate>Sun, 17 Apr 2011 15:06:58 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://www.egstudio.biz/?p=658</guid> <description><![CDATA[When we created our coming soon page, we've decided to tweak it up a bit by making a cool parallax effect between the content and the background of the website. In this tutorial we will demonstrate how to create a basic instance of the parallax effect using jQuery.]]></description> <content:encoded><![CDATA[<p>When we created our <a
href="http://www.egstudio.co.il">coming soon page</a>, we&#8217;ve decided to tweak it up a bit by making a cool parallax effect between the content and the background of the website. In this tutorial we will demonstrate how to create a basic instance of the parallax effect using <strong>jQuery</strong>.</p><h2>What is a &#8220;Parallax Effect&#8221;?</h2><p>Wikipedia describes the parallax effect as &#8220;an apparent displacement or difference in the apparent position of an object viewed along two different lines of sight, and is measured by the angle or semi-angle of inclination between those two lines&#8221;. But I refer to it as &#8220;The cool effect that you can control by moving the mouse!&#8221;.</p><h2>The Code &amp; Logic</h2><p>Here is the full code:</p><pre class="brush: jscript; title: ;">
var movementStrength = 15;
var height = movementStrength / $(window).height();
var width = movementStrength / $(window).width();
$(&quot;html&quot;).mousemove(function(e){
		  var pageX = e.pageX - ($(window).width() / 2);
		  var pageY = e.pageY - ($(window).height() / 2);
		  var newvalueX = width * pageX * -1;
		  var newvalueY = height * pageY * -1;
		  $('body').css(&quot;background-position&quot;, newvalueX+&quot;px &quot;+newvalueY+&quot;px&quot;);
});
</pre><p>Now, I will explain each part:</p><pre class="brush: jscript; title: ;">
var movementStrength = 15;
var height = movementStrength / $(window).height();
var width = movementStrength / $(window).width();
</pre><p>Here I create a variable called &#8220;movementStrength&#8221;. This variable determines the maximum amount of movement which I allow the designated object to move in pixels. So in this case I&#8217;ve decided to limit this object (in this case the html body tag) to 15 pixels on each side (left / right / up / down).</p><p>The parallax moves in relation to a relative space, in this case the window or the screen size. So by dividing the movementStrength value with each of the correlating height and width values I can determine how many pixels is 1 movement point.</p><p>In this case 1 movement point on a 1920&#215;1080 resolution (on the X axis) is 0.0078125 pixels, so if you move 0.0078125 pixels 1920 times you will get a total of 15 pixels &#8211; the threshold we set.</p><pre class="brush: jscript; title: ;">
$(&quot;html&quot;).mousemove(function(e){
	...
});
</pre><p>Since I want my effect to move with the mouse I will call the function that will cause the actual effect using the jQuery &#8220;<a
href="http://api.jquery.com/mousemove/">mousemove</a>&#8221; event. Now lets look on how the actual function works:</p><pre class="brush: jscript; title: ;">
$(&quot;html&quot;).mousemove(function(e){
	var pageX = e.pageX - ($(window).width() / 2);
	var pageY = e.pageY - ($(window).height() / 2);
	var newvalueX = width * pageX * -1;
	var newvalueY = height * pageY * -1;
	$('body').css(&quot;background-position&quot;, newvalueX+&quot;px &quot;+newvalueY+&quot;px&quot;);
});
</pre><p>Now I want to know where the mouse is, in relation to a point of focus (which in this case is the center of the screen).</p><pre class="brush: jscript; title: ;">
var pageX = e.pageX - ($(window).width() / 2);
</pre><p>Here I define a variable called pageX and I fill it with the current distance of the mouse from the focus point (the window width / 2  i.e the center of the screen).</p><pre class="brush: jscript; title: ;">
var newvalueX = width * pageX * -1;
</pre><p>Afterwards I the this relative value multiply it with the width movement point value (if you remember movementStrength/ScreenWidth = 1 horizontal movement point) and I multiply it with -1 so that I can create a mirror movement of the mouse instead of a following movement.</p><pre class="brush: jscript; title: ;">
$('body').css(&quot;background-position&quot;, newvalueX+&quot;px &quot;+newvalueY+&quot;px&quot;);
</pre><p>In the end I use the new position values to change the background position of the designated DOM element.<br
/> In this case I chose to move only the background, but I can move an entire element just as well.</p><p>This is a basic implementation of the parallax effect. To make it more interesting try implementing the effect on more then 1 element changing the movementStrength to from the closest visually to the farthest (closest gets the bigger value) and you can make a nice 3D effect.</p><p>I hope you&#8217;ve enjoyed this quick tutorial. If you did, please comment, tweet or share this tutorial with your friends!</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/easy-parallax-with-jquery/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Simple jQuery Robot Animation</title><link>http://www.egstudio.biz/simple-jquery-robot-animation/</link> <comments>http://www.egstudio.biz/simple-jquery-robot-animation/#comments</comments> <pubDate>Wed, 13 Apr 2011 07:00:39 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://10.0.0.145/egstudio/?p=372</guid> <description><![CDATA[This tutorial is based on work we did for Noliosoft a few months ago. We wanted to animate our center piece in several repeating frames using jQuery. Here is how we did it.]]></description> <content:encoded><![CDATA[<p>This tutorial is based on work we did for Noliosoft a few months ago. We wanted to animate our center piece in several repeating frames using jQuery. Here is how we did it.</p><p><strong>Step 1 &#8211; Prepare the frames</strong><br
/> Prepare your frame using image sprites, it doesn&#8217;t matter how many, just keep the image in reasonable size.<br
/> <a
href="http://www.egstudio.biz/wp-content/uploads/2011/04/robo_head.png"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/04/robo_head.png" alt="" title="robo_head" width="118" height="726" class="alignleft size-full wp-image-722" /></a></p><p><strong>Step 2 &#8211; Place the image using CSS</strong><br
/> Position the image, in our case it is very simple. The background is static, whereas the head is positioned absolutely on top of it.</p><pre class="brush: css; title: ;">
/* main item */
#mainitem { height:420px; position:relative; background: url(../img/robo_bg.png) no-repeat top left; }
#head { height: 121px; width: 118px; position: absolute; top: 81px; left:407px; background: url(../img/robo_head.png) no-repeat top left;   }
</pre><p><strong>Step 3 &#8211; Animate the sprites</strong><br
/> Now it is time to animate the sprites using JS. Place the code at the bottom of the document.</p><p>Define a variable to start the animation and another for the time.</p><pre class="brush: jscript; title: ;">
/** Robot Animation **/
var z = doAnimation();
var t;
</pre><p>Define the function that will call the animation after a specific interval, in our case 400 milliseconds. This has to be a function so the process could be repeated.</p><pre class="brush: jscript; title: ;">
function doAnimation(){
    t = setTimeout(animateRobo, 400);
}
</pre><p>Define the actual animation function, in our case the frames are random but you can do it however you like to. See that after we change backgrounds we call <b>doAnimation</b> again so the process repeats it self.</p><pre class="brush: jscript; title: ;">
/* Credit to VI for simplification */
function animateRobo() {
    var num = Math.floor(Math.random()*5);
    $('#head').css('background-position', '0 -' + (num * 121) + 'px');
    var x = doAnimation();
}
</pre><p><strong>Step 4 &#8211; Adding a stop function (optional)</strong><br
/> Even though not necessary, sometimes you might want to stop the animation. Just enter the following function to stop and reset the animation.</p><pre class="brush: jscript; title: ;">
function stopAnimation(){
	clearTimeout(t);
	$(&quot;#head&quot;).css(&quot;background-position&quot;, &quot;bottom left&quot;);
	return false;
}
</pre><p>Then you can add the actual event:</p><pre class="brush: jscript; title: ;">
$(&quot;a.your-selector&quot;).hover(function(){ stopAnimation() }, function(){ doAnimation() });
</pre><h2>Putting it all together</h2><p>Here is an example of the full source code:</p><pre class="brush: jscript; title: ;">
/** Robot Animation **/
var z = doAnimation();
var t;
function doAnimation(){
    t = setTimeout(animateRobo, 400);
}
/* Credit to VI for simplification */
function animateRobo() {
    var num = Math.floor(Math.random()*5);
    $('#head').css('background-position', '0 -' + (num * 121) + 'px');
    var x = doAnimation();
}
function stopAnimation(){
	clearTimeout(t);
	$(&quot;#head&quot;).css(&quot;background-position&quot;, &quot;bottom left&quot;);
	return false;
}
$(&quot;a.demo&quot;).hover(function(){ stopAnimation() }, function(){ doAnimation() });
</pre><h2>Demo</h2><p>This tutorial can be viewed on <a
href="http://releaseengineerforhire.com/" target="_blank">Release Engineer For Hire</a>. If you liked this tutorial or have any questions, let us know so, just post a comment below or Tweet us.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/simple-jquery-robot-animation/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Site Owners Guide to SEO</title><link>http://www.egstudio.biz/site-owners-guide-to-seo/</link> <comments>http://www.egstudio.biz/site-owners-guide-to-seo/#comments</comments> <pubDate>Thu, 07 Apr 2011 14:00:23 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://www.egstudio.biz/?p=654</guid> <description><![CDATA[A  site owners guide to SEO (Search Engine Optimization) is a collection of almost 20 concise tips and guidelines for site owners and webmasters about optimizing your website for search engines.]]></description> <content:encoded><![CDATA[<p>A <strong>site owners guide to SEO</strong> (Search Engine Optimization) is a collection of almost 20 concise tips and guidelines for site owners and webmasters about, well, SEO.</p><h2>1. Write your content for people</h2><p>Forget about optimizing your content for search engines, when users reach your website they need a clear message, not a programmed one.</p><h2>2. Fill your meta tags</h2><p>The most important meta tags are the title and description. They are what we eventually see in search results. Try to give each page a different title and keep your naming system consistent. Keep both description and title in reasonable sizes and relevant to each pages&#8217; content.</p><h2>3. Use clean URL</h2><p>A standard feature most systems allow today. Try to make use of it. Keep the names short and consistent. If you must use spacing between words use a &#8220;-&#8221; instead of &#8220;_&#8221;.</p><h2>4. Don&#8217;t avoid using any technology (Flash)</h2><p>Saying that any technology is bad for search engines is plain bullshit. Use it if it&#8217;s needed, use it if it makes your conversion rate go up and use it if it&#8217;s the best solution around. That being said, prefer using native browser technologies for interactive elements, use Flash for movie players.</p><h2>5. Use semantics in your content</h2><p>Good semantics makes your code more readable for search engines. Use native HTML elements to wrap your content. It makes it more readable and better looking for search engines. When doing this, try to wrap phrases instead of words.</p><p><strong>Good example</strong>:</p><pre class="brush: plain; title: ;">
&lt;h1&gt;Coding for search engines&lt;/h1&gt;
&lt;p&gt;&lt;a href=&quot;#&quot;&gt;Lorem ipsum vix alii constituam&lt;/a&gt; signiferumque no, ea pri movet omnes, in his malorum sensibus. Dicunt eirmod vix cu, eruditi denique recusabo ut sit.
&lt;strong&gt;Commune liberavisse signiferumque&lt;/strong&gt; ex mei, cu viderer indoctum has.&lt;/p&gt;
</pre><p><strong>Bad example</strong>:</p><pre class="brush: plain; title: ;">
&lt;span class=&quot;header&quot;&gt;Coding for search engines&lt;/span&gt;
Lorem ipsum vix alii constituam signiferumque no, ea pri movet omnes,
in his malorum sensibus. Dicunt eirmod vix cu, eruditi denique recusabo ut sit.
Commune liberavisse signiferumque ex mei, cu viderer indoctum has.
</pre><h2>6. Avoid using shortcuts</h2><p>There are shortcuts to SEO, commonly referred to as <a
href="http://en.wikipedia.org/wiki/White_or_black_hat" target="_blank">black hat SEO</a>. Avoid these methods and avoid the people who use them, they probably are people who look for shortcuts in life as well.</p><h2>7. It&#8217;s all about fine tuning</h2><p>Avoid drastic changes. Try to change each small portion at a time, measure the results and repeat the process. This way you&#8217;ll be able to keep track of what&#8217;s working and what&#8217;s not.</p><h2>8. Use social networks</h2><p>Use social networks like Facebook and Twitter to generate links to your website. Try to think of a creative way of doing it instead of just harvesting &#8220;likes&#8221; or picking at your friends. A good place to start is to have a noticeable &#8220;share&#8221; button on your website.</p><h2>9. Validate your website&#8217;s code</h2><p>Though not the most important aspect, you still want to make sure the search-bots are reading your website as its meant. When editing content it often happens that tags get displaced and create code errors. Use the <a
href="http://validator.w3.org/">W3C validation tool</a> in order to check your website is up to standard.</p><h2>10. Do a keywords research</h2><p>Use <a
href="https://adwords.google.com/select/KeywordToolExternal">Google AdWords keywords tool</a> and <a
href="http://www.google.com/trends">Google Trends</a> to determine which keywords are more relevant to your website and which have the largest search volume. When applicable try to use these keywords on your meta titles, description, headers and content.</p><h2>11. Use online tools</h2><p>Register your site to <a
href="http://www.google.com/webmasters/tools/">Google Webmasters Tools</a> and <a
href="http://www.google.com/analytics/">Google Analytics</a>. It will help you analyze your progress better.</p><h2>12. Have a sitemap</h2><p>Both for Google, commonly known as sitemap.xml and for actual users who want to see what&#8217;s going on. Update your sitemap whenever you delete or add a page, it will help you avoid broken links.</p><h2>13. Have a 404 page</h2><p>In short, be ready when the search-bots start clicking broken links. Provide links back to your homepage and other important pages on your website. Here&#8217;s an example of <a
href="http://www.egstudio.biz/404" target="_blank">our 404 page</a>.</p><h2>14. Site performance is key</h2><p>Make sure your website loads fast and I&#8217;m not talking about testing it on your lame connection at the office. Use professional tools to examine your websites&#8217; load speed. Try to implement the suggestions as much as you can, load speed affect bounce rate directly.</p><h2>15. Concentrate your efforts locally</h2><p>It&#8217;s usually faster and easier to target a local audience with SEO. Use a local domain and a local language on your domain. Avoid adding other languages unless it&#8217;s absolutely necessary, if you&#8217;re audience is global use English.</p><h2>16. Create your own perspective</h2><p>There is a tons of information about SEO on the web. Read as much as you can to develop your own view on things. But try not to get too confused or caught up with the importance of SEO and remember that SEO is only one aspect of web marketing.</p><h2>17. Know when to hire professionals</h2><p>Hire professionals only if the following applies: a large portion of your target audience comes from the internet, you have fierce competition, you do not have the time to look after it yourself and you have the budget for it. Otherwise it will be a waste of your time.</p><h2>18. Be patient</h2><p>If you did hire professionals or started yourself, be patient &#8211; these things take time. The longer your website is out there, the better it&#8217;s recognized by search engines.</p><h2>19. Further reading</h2><p>If you decided to go with the &#8220;do it yourself&#8221; method, don&#8217;t be lazy, explore the subject further. A good start would be reading blogs like <a
href="http://www.seomoz.org/blog" target="_blank">SEOMOZ</a> or <a
href="http://www.seobook.com/blog" target="_blank">SEOBOOK</a>.</p><h2>What do you think?</h2><p>We realize that some of what&#8217;s written here will not be acceptable by all SEO professionals. This is just our sane view, meant to help site owners and webmasters to make better informed decisions about their websites, so let us know what you think.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/site-owners-guide-to-seo/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Easycard Module For Prestashop</title><link>http://www.egstudio.biz/easycard-module-for-prestashop/</link> <comments>http://www.egstudio.biz/easycard-module-for-prestashop/#comments</comments> <pubDate>Sun, 03 Apr 2011 07:00:06 +0000</pubDate> <dc:creator>egstudio</dc:creator> <category><![CDATA[Blog]]></category> <guid
isPermaLink="false">http://10.0.0.145/egstudio/?p=307</guid> <description><![CDATA[Easycard allows Israeli merchants to process credit cards online via payment gateway. This module was developed for Prestashop 1.3x and up. Once installed, you need to define your <strong>client id</strong> and <strong>password</strong>. You can also set how many payments you would like to allow your customers to choose from.]]></description> <content:encoded><![CDATA[<p>Easycard allows Israeli merchants to process credit cards online via payment gateway. This module was developed for Prestashop 1.3x and up. Once installed, you need to define your <strong>client id</strong> and <strong>password</strong>. You can also set how many payments you would like to allow your customers to choose from.</p><p><span
id="more-307"></span><br
/> <a
href="http://www.egstudio.biz/wp-content/uploads/2011/03/e-c-screen.jpg"><img
src="http://www.egstudio.biz/wp-content/uploads/2011/03/e-c-screen.jpg" alt="" title="e-c-screen" width="587" height="408" class="alignleft size-full wp-image-705" /></a></p><p><b>Important note</b>: in order to use this module and allow credit card payments through your website you have to make sure that the correct steps have been taken:</p><ol><li>You are a client of <a
href="http://e-c.co.il/" target="_blank">Easycard</a>.</li><li>You have an SSL certificate installed on you server.</li></ol><h2>Download</h2><p>Downloading is currently distributed freely under the <a
href="http://www.gnu.org/licenses/gpl.html" target="_blank">GPL license</a>. You can download the module by <a
href="/thank-you/?d=307">clicking here</a>. If you would like to request a feature or send feedback please post a comment below or <a
href="http://twitter.com/egstu">tweet us</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.egstudio.biz/easycard-module-for-prestashop/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
