MySQL Duplicate a Table – Quick Tip

Looking to duplicate a table into a new table – it is very simple:

   CREATE TABLE `high_risk_old` LIKE high_risk;
   INSERT INTO `high_risk_old` SELECT * FROM `high_risk`;
Advertisements

Tips for applying for a web developer role

Here it is, an ad for a front-end developer/designer on Seek.

Since putting up the ad we have received some brillant and some terrible resumes.

This has lead me to think that web developers need some guidelines when they are seeking a new job.

  1. You must have a personal site. This is critical, you are a web-head, you advocate the web, you love the web, I expect you to have a website. This does not have to be the world’s most mind blowing site. Just something that is going to show you can at least put some code together. If you are a hardcode developer and cannot design than use Twitter BootStrap, at least it will look neat. If you are a designer than the site needs to look awesome!
  2. Back-end and front-end are very different roles. Sometimes the lines are very blurred, other times it isn’t. Your strength is going to be one or the other. If it is a back-end role, than Java, Ruby, PHP, C++ or Python (insert other server-side language) should be a big part of your background. If it is a front-end role HTML, CSS, JavaScript, PhotoShop, Illustrator, and basic server-side should be a big part of your background.
  3. If the job is for UX/UI your resume must reflect this, even if it isn’t, you are a tech-head so it should show a logical organisation. DO NOT USE THE STANDARD WORD TEMPLATES!!! They are horrible and lead to a bad user experience.
  4. Explain your role on projects. Do not list one of the world’s largest sites with a vague one word description of your role. Clarify exactly what you did. Otherwise there is no way of knowing if you were the UX lead who designed the end-to-end customer experience or the tea-lady.
  5. Do not list your ex-company’s projects unless you were on them, and if you were on them, list what your role and accomplishments were.
  6. DO NOT CLAIM OTHERS’ WORK AS YOURS. Are you serious? Do you honestly think that you will not be caught out? Come on! If you do not get caught in the interview process, you will be caught out once you start and your new employers will be very upset. Though I get the feeling if you are in this group you are like one of the applicants who’s code samples still contained the original author’s links in the footer.
  7. This is professional process, so treat it as such. While you can be quirky and this is encouraged, do not put not safe for work content in your resume. Check your spelling. Consistently format your resume. Write a cover letter covering each of the requirements. Write a two to three sentence introduction in the email.
  8. Make me want to hire you. You are a product, you need to make me want to spend money on you. Tell me about how you will make us successful, especially when I put exactly how you will in the job ad.
  9. Provide samples of your work. These can be code samples, wireframes, mockups, GitHub, your blog posts, side projects, StackOverFlow responses, Redit etc. as long as you created it. Given the fact it is so easy to create side-projects online there is zero reasons for not having something you created.
  10. Do not apply for roles above your experience level. If you are straight out of uni you will do well, just don’t apply for a role which is requiring you take on responsibility beyond your ability (there is of course exceptions). There is plenty of opportunity to jump in the deep-end. Just get some experience first.

PHP Multi-thread Asynchronous Process Manager

PHP Multi-thread Asynchronous Process Manager

I have been build some background apps recently which need to do a lot of repetitions (think 100,000 times the same task which takes about 0.25 to 1 second to execute, of which most of it is waiting for the remote server to respond). Since these are daily and are not that server intensive it made sense to run them concurrently so instead of taking the good part of the day it just takes a few hours. I noticed on the proc_open page there was a very nice solution by Matou Havlena of havlena.net.

Continue reading “PHP Multi-thread Asynchronous Process Manager”

Password Hashing – With some smart salt

Password Hashing – With some smart salt

Basic hashing of passwords is poor. LinkedIn should have expected that one day that their password list would be stolen and when that happened it should have been hashed better so a standard dictionary could not reverse the passwords. Tthe LinkedIn passwords were leaked all over internet and with the help of crowd-sourced hackers the passwords were easily reversed back from SHA-1 hashes substrings to the plain text passwords. With tools like John the Ripper social hackers like Francois Pesce was able to reverse over 2 million LinkedIn passwords.

Continue reading “Password Hashing – With some smart salt”

Getting the directory listing using PHP's Glob Function

The other day the new developer  in my office wanted to get a directory listing using  PHP as he was writting a new plugin for WordPress. To his surprise this is really easy with the glob() function:

<?php
foreach (glob("*") as $filename) {
    echo $filename . 'size ' . filesize($filename) . 'n';
}

 

Glob allows you to use patterns similar to those when you are using the ls command in Terminal and returns the file list as an array.

Get the HTML of any page with PHP

Quick tip: if you want to get the HTML for any web page you can use the PHP function file_get_contents(). To see the HTML in your web browser wrap the htmlentities  function around the file_get_contents() function.

<?php

echo htmlentities(file_get_contents('http://example.com'));

Which returns:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>IANA &mdash; Example domains</title>
	<!-- start common-head -->
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="/_css/2008.1/reset-fonts-grids.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="/_css/2008.1/screen.css" />
	<link rel="stylesheet" type="text/css" media="print" href="/_css/2008.1/print.css" />
	<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
	<script type="text/javascript" src="/_js/prototype.js"></script>
	<script type="text/javascript" src="/_js/corners.js"></script>
	<script type="text/javascript" src="/_js/common.js"></script>
	<!-- end common-head -->

</head>
<body>
	<!-- start common-bodyhead -->
....
	<!-- end common-bodytail -->

</body>
</html>