Purencools Blog

I had some issues installing Compass on Ubuntu 14.04 this is what I did and the errors I came up against that gave me a large headache. I hope others can benefit from what I learnt. This assumes that you have already created a sub-theme in Omega4. I installed the following packages initially:

The more and more I use vim the quicker my productivity becomes this has allowed me streamlined my development tool chain. One of the issues over the years I kept finding myself doing is extending vims functionality to make it work like an IDE and more mouse friendly. I happen to find these videos on how to use vim from Derek Wyatt.org.

Regex can be so difficult but because of its ability to be so flexible it becomes necessary to use when searching a string that could have multiple variants. PHP uses the PCRE format so this could be used in other formats. Below are patterns I constantly use,

 

Searching for a characters with tags in a string

// String to be searched
1111<thumbnail code='1150400' />2222 

// Regex pattern
/<thumbnail code='.+?' \/>/

// Response
<thumbnail code='1150400' /> 

Searching for the code in a string

Grep is a powerful tool but remembering the commands at times does affect your ability to be productive because you don't use it all the time and to recall them can be a headache. Below are important ones I uses at times

 

Searching a document for a word

~$ grep <searchterm> or <"search term">  <path/filename>

Apache2 has changed the way you can deploy your websites under /etc/apache2/sites-available/ the hosted directive file names need to end in .conf eg, purencool.aust.dev.conf. Below are some commands need to run Apache2 web server from the command-line

 

To enable a website on Ubuntu.

~$ a2ensite <sitename.conf> //Creates a symlink to sites-enabled

To disable a website on Ubuntu.

~$ a2dissite <sitename.conf> //Removes the symlink to sites-enabled

The more web development I do the more I use Vim and Vim buffers. Wow, once you get your head around not using the mouse and the editing keys which are more than "i" it really does speed you up. Below are some of the keys that I need to remember.

 

This closes the current buffer that you are in.

 :bd

This moves to the next buffer.

 :bn

This to goes back to last buffer.

 :bp

Lists all the hidden buffers.

 :ls

Deletes the character that the cursor is on.

x //in visual mode

Now that Drupal 8 is starting to use Drupal components I thought that it would be in my best interest to try installing Symfony 2 and read up on its components and how they work. From the start what you find is that it does nothing even after you have created a Bundle. Yaml is completely foreign. But after going through the Symfony 2 Cook Book things started to make sense. I love the command line tools and composer wow and to see it all in OOP, sorry Drupal but it just makes so much more sense and I don't feel like I need to belt my head up against a brick wall and then jump off a cliff.

Redirect rules in apache .htaccess are very useful. Below are some examples that allow you to achieve some simple tasks that I use on a regular basis.

Testing to see if htaccess is working?

The best thing to do in this circumstance is find or create a file called .htaccess in your root directory and add a whole lot of characters and then open your browser. Navigate to the url in the browser. Refresh the page and you will either see an error from the web server or you'll get a blank page.

The use of Less and Scss is almost becoming mandatory. What I have been finding is that different projects want to use Less or Scss when doing web development, this is a real pain to constantly setup especially if you want to do a small update on one development. Below I have created two Bash scripts to automate the process.

As this Drupaler has found the question What is a Drupal Developer? is not an easy one to answer. During the last few months what became more and more apparent to me is if you are new to Drupal this is a question that is asked a lot and because Drupal is a complex system it is not the easiest thing to explain. So here goes

 

Pages