• Subscribe to the RSS feed!
  • Subscribe by Email
  • home
  • blog
  • dev
  • Recent Posts

    • Toggler
      • on February 4, 2010
    • Book review - jQuery 1.3 with PHP
      • on January 6, 2010
    • 2009 in a few words
      • on January 2, 2010
    • Bad Firebug!
      • on December 21, 2009
    • Posterous
      • on December 2, 2009
    • Chaining routes in Zend Framework
      • on November 27, 2009
    • Zend Framework bug hunt days
      • on November 22, 2009
    • Zend Framework 1.8 Web Application Development book review
      • on November 17, 2009
    • A book review
      • on October 11, 2009
    • Playing with Zend_Navigation and routes
      • on August 9, 2009
  • Recent Comments

    • Aryashree Pritikrishna
      • on January 28th @ 9:10 am
    • Michl
      • on January 15th @ 10:09 am
    • Robert
      • on January 2nd @ 1:36 pm
    • Ivan
      • on January 2nd @ 1:33 pm
    • Keith Pope
      • on January 1st @ 11:57 am
    • Jani Hartikainen
      • on December 29th @ 8:55 am
    • johnjbarton
      • on December 22nd @ 1:01 am
    • Robert
      • on December 21st @ 11:55 pm
    • René Silva
      • on December 21st @ 11:47 pm
    • Robert van Drunen
      • on December 21st @ 6:37 pm
  • Tags

    • php
    • framework
    • zend
    • example
    • random
    • about
    • site
    • ubuntu
    • blog
    • introduction
    • book
    • wordpress
    • linux
    • apache
    • lamp
    • setup
    • review
    • open source
    • svn
    • comic
  • Categories

    • Blablabla
    • Development
    • Free time
    • Places on the web
    • Programming
    • Software
  • Archives

    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • August 2009
    • May 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
  • Find me on

    • DZone
    • Google Code
    • Google Reader
    • Last.fm
    • StumbleUpon
    • Twitter
    • Vimeo
  • Friends and Blogs

    • Andrew Taylor
    • Andy Sowards
    • Bojan Pejić
    • Eran Galperin
    • Graham Smith
    • Jani Hartikainen
    • Jasper Tandy
    • Matthew Turland
    • Matthew Weier O’Phinney
    • Miff
    • Miloš Ćuković
    • Nebojša Radović
    • Nemanja Avramović
    • Nemanja Tobić
    • Nikola Krajačić
    • Nikola Plejić
    • Pádraic Brady
    • Rob Allen
    • Swizec Teller
    • Vladimir Stanković
    • WeAreJustCreative
    • Željko Stevanović
  • I use

    • 960 Grid System
    • jQuery
    • Notepad++
    • Subversion
    • Trac
    • Vim
    • Zend Framework

Archive for September, 2008

Smush your images!

by Robert Basic on September 30th, 2008

I just found a nice web site where you can “smush” your images — Smushit.com. SmushIt takes an image and removes all unnecessary information about it: when was it last edited, what image editor was used etc., but keeps the quality of the image! This is more than useful for sites where there are lots of images.

The result of smushing

The result of smushing

There are several ways to provide images to SmushIt:

  • Upload an image
  • Provide an URL to the image
  • Use the Firefox SmushIt add-on

The first two ways are quite obvious; provide an image and it’ll process it in a few seconds.

The Firefox add-on is pretty cool: open up a web page where are the images you want to smush, click the SmushIt add-on icon (it’ll be in the right corner of the status bar), it will take you to their site and process all the images found on your web page.

When the processing is complete, there will be a table showing details about the smushing. Also a download link will be provided, to download the smushed images in one zip file.

Now run little lurker and smush your images :)

Tags: image, optimize, site, web.
Categories: Development, Places on the web.
Comments: 4.

Creative License

by Robert Basic on September 25th, 2008

A few days ago, I wrote about Freelance Freedom, a design related comic by N.C. Winters. Now, he’s here with another comic, called Creative License, which will also be a weekly comic. Since the first number came out on Wednesday, I think all the following numbers will come out on that day. I hope it’s gonna be good as Freelance Freedom :)
Enjoy it, I’m sure I will!

Tags: comic.
Categories: Blablabla, Free time.
Comments: Comments Off.

Facebook registration, part 2

by Robert Basic on September 23rd, 2008

A few days ago I wrote about a problem with registering an account on Facebook. This morning, I’ve got the reply:

Hi Robert,
Welcome to Facebook. We have confirmed your account, and you should be able to access it now. Sorry for the delay!
Login:
New Password:
Please note that Facebook passwords are case sensitive (FACEbook is not the same as facebook). If you’re having trouble with this login/password combination, I suggest copying and pasting the login and password into the appropriate fields.
Once logged in, you can change your password from the “Settings” tab of the Account page. Let me know if you have any further questions.
Thanks for contacting Facebook,
Sadie
User Operations
Facebook

Not a word on what was causing the system to reject my registration. At least, I’ve got one “sorry”.

Well, I have my Facebook account now, so if you’ll excuse me, I’m off to find some long lost friends :)

Tags: facebook, registration.
Categories: Blablabla, Free time.
Comments: Comments Off.

Regular expressions with PHP

by Robert Basic on September 22nd, 2008

I just want to write some real examples. These regexps are (and always will be, ’cause I plan to write several posts on this topic) for the PHP’s PCRE library. Here’s a good PHP PCRE cheat sheet, it’s an excellent resource for regexps. If you know nothing about regexps, first read this Wiki page.

Regexps for <a> tags

A common case is when you have a source of some web page and you want to parse out all the links from it.
An anchor tag goes something like this:

<a href="http://example.com/" title="Some website">Website</a>

Also it can have more attributes, like class, target etc. Knowing how it’s built up, we can start writing a pattern, depending on what we want.
Here are some examples, some explanations are in the comments:

<?php
// Regexp examples for <a> tags

/**
* Different combinations...
* $matches_comb[0] contains the whole <a> tag
* $matches_comb[1] contains what's inside the "href" attribute
* $matches_comb[2] contains what's after <a> and before </a>
* with the "s" modifier mathces <a> tags that are broken in several lines,
* ie. matches <a> tags with newlines
* without the "s" modifier, matches only <a> tags without a newline
*/
preg_match_all(
    '#<a\s.*href=["\'](.*)["\'].*>(.*)</a>#isxU',
    $string,
    $matches_comb
);

/**
* Match only what's inside the href attributes...
*/
preg_match_all(
    '#<a\s.*href=["\'](.*)["\'].*>.*</a>#isxU',
    $string,
    $matches_href
);

/**
* Match only what's inside the href attirbutes,
* only when it starts with http:// and includes http://
* $mathces_href_http[0] contains some trash also, nevermind,
* $mathces_href_http[1] contains exactly what we need
*/
preg_match_all(
    '#<a\s.*href=["\'](http://.*)["\'].*>.*</a>#isxU',
    $string,
    $matches_href_http
);

/**
* Match all Email addresses - mailto:
*/
preg_match_all(
    '#"mailto:(.*)"#',
    $string,
    $matches_emails
);

?>

Play around with these patterns, see what’s for what, experiment, that’s the best way to learn regexps.
Do you have some more regexps for links? Some better ones than these here?
Happy hacking!

Tags: example, pcre, php, regex, regexp.
Categories: Development, Programming.
Comments: None.

Facebook registration

by Robert Basic on September 18th, 2008

I tried to register on Facebook. I filled up the register form, typed all the information, double-checked for errors… Clicked “Sign up”, and they gave me a big read box saying:

Our automated system will not approve this name. If you believe this is an error, please contact us.

Wtf?! My name is wrong?! How could it be wrong?! I checked it again, refilled the form, and… same error again. OK, their system is messed up, I don’t like those troubleshooting systems, those are never helpful, so I’ll try again later. A few minutes after, I tried again. Same thing. Weird. Then I did a Google search on “Robert Basic Facebook” terms. First hit: a Facebook profile for Robert Basic. Yep, there’s a person, with same name as mine, registered on Facebook. So, I used their troubleshoot system, which ended up writing them an E-mail:

Hi there!
I am Robert Basic, from Serbia, age 22.
Well, I’m having trouble registering on Facebook. There is already a guy registered on Facebook, we share the same name, so maybe that’s the problem. Anyway, we are two separate persons, he lives in Germany, I live in Serbia. Is there a solution for this problem? Oh, and the error I got was:
“Our automated system will not approve this name. If you believe this is an error, please contact us.”
So there. I’ve made contact. I come in peace.
Regards,
Robert

The E-mail is sent, now I’m waiting to see what will happen next.

Frankly, I don’t give a damn about having a Facebook profile; well, not anymore. Now, I just want to know, how could this happen? They never thought about this scenario when two persons have same names? OK, maybe, I’m wrong and this error comes up because of something else, but for me, this is the only reasonable explanation.

Tags: error, facebook, registration.
Categories: Blablabla, Free time.
Comments: 4.
12 » Last
Robert Basic © 2008 — 2010
Design & graphics by: Livia Radvanski
Coded by: Robert Basic
Home page last updated on November 30th, 2009.
Frameworks used: Zend Framework, jQuery, 960 Grid System
Blog is powered by Wordpress
Subscribe: Entries — RSS & Comments — RSS