Wednesday, September 19, 2012

Retina effect with jQuery

This is seriously one of the coolest jQuery effects I've seen recently.

/tmp/mysql.sock not found on Mac OS 10.8.1

  1. Step 1 Kill all the mysql processes you have
    ps aux | grep mysql sudo kill -9 PROCESS_ID
  2. Step 2 Find your mysql.sock file
    locate mysql.sock
  3. Step 3 User this file to symlink to /tmp/mysql.sock
    ln -s /private/var/mysql/mysql.sock /tmp/mysql.sock

Adding Google Analytics to your page

  1. Step 1:Create your new analytics account if you haven't already.

  2. Step 2:Go to the account and click the admin button
  3. Step 3:Choose the Tracking Code tab
  4. Step 4:Copy and paste the tracking code you'll find near the bottom
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-34933034-1']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  5. Step 5:Open your account in and go to the blog account

  6. Step 6:Click Edit HTML and proceed. Then paste in the script code from above underneath right about the tag.
  7. Step 7:In your developer tools you can check that this works by looking in your Network secton to see if the __utm.gif is set with the correct account number. To do so click the gif and look for the utmac value (UA-XXXXXX-1) and it should match that value found in the JS you just pasted in.

Adding the GCC compiler for Mac OS 10.8.1 and Xcode

I just installed Mountain Lion on my machine and suddenly my apache would not start due to an error with the file.
sudo /usr/local/apache2/bin/httpd --restart httpd: Syntax error on line 56 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/libexec/apache2/ into server: dlopen(/usr/libexec/apache2/, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/ mach-o, but wrong architecture
Doing a file on gives the following:
file /usr/libexec/apache2/ /usr/libexec/apache2/ Mach-O 64-bit bundle x86_64
This tells me that the .so file I have has a 64 bit architecture but my apache is 32 bit.
file /usr/local/apache2/bin/httpd /usr/local/apache2/bin/httpd: Mach-O executable i386
Great, so now I need to find a way (quick and easy without having to change too many things) to compile mod_rewrite for a 32 bit architecture. After alot of Googling I finally decided to update my Xcode to 4.4.1 The download was 1.56G.

Now the download is finished and after updating my locate I did a

locate gcc | grep bin

With this I found the gcc from Xcode that I just installed.

Doing a file gave me

file /Developer/usr/bin/gcc
/Developer/usr/bin/gcc: Mach-O universal binary with 3 architectures
/Developer/usr/bin/gcc (for architecture i386): Mach-O executable i386
/Developer/usr/bin/gcc (for architecture ppc7400): Mach-O executable ppc

So what's the flag for using gcc for the 32 bit architecture?? (IN PROGRESS)

Using Google Search Operators

Today I found a good link on using Google's search operators. I stumbled across it while looking for a way to find a website's backlinks. Google Guide Search Operators Here you'll find tips like these and others To find the backlinks to a page use the following as search query: