Drupal, Silex, Symfony2, Ubuntu, Website Development

Git commands that we all need to remember

Git is fantastic but there are times when you need to find that odd command because you have stuffed something up. Here are some I use on those occasions, firstly open the terminal and navigate to the root directory of the Git repo.

You didn't want to commit that

~$ git reset --soft HEAD~1

I want to remove the second last commit

~$ git rebase -i HEAD~2

The master branch commits have moved ahead from my-current-branch when I first branched off

~$ git checkout my-current-branch
~$ git rebase master

I need to see the changes before I commit

~$ git diff [filename]

I need to see a users commits in the logs

~$ git log --author="username"

I want see what was committed

Read more

Git merge branch and commit individual files

Merging two Git branches and then commiting each merge file seperaterly looks easy except while in a merge Git will not let you do it. This howto will explain one way how to do it. Firstly go to the terminal window and move to the Git directory that you want to merge.  In this example I am going to merge the large-branch-to-be-merge into the master. Check out the master branch or the branch you want to merge like the example below.

~$ git checkout master
~$ git branch
    large-branch-to-be-merge
    *master

The next step is to do the merge so that your wonderful new set of code will make the amazing changes to the software.

Read more

Drupal development environment

As a Drupal click monkey I came away from Drupalcon Sydney determined that I was going to contribute back to Drupal in some way. The big push in the community is to help with core development and the issue cues if you are able. But to a new Drupaler it is like looking at a mountain you need to climb and the only tool you have is a toothpick. I was listening to a Drupalise.me podcast that was discussing contributing back to the community, what I found interesting about the conversation was when they started to contribute it was like looking at a mountain to climb and only having a toothpick. I was not alone it seems.

Read more

Embed views into a Drupal node.tpl

On a project early this year I found the need to add a view of images between the content type body and comments. I looked at context module as I have used it before. But on reflection the website was very small and I didn't see the need to install an extra module for this small job.  After some research I found the function views_embed_views this allows the developer to add a view to a tpl file using code. This post shows you how you can do it for yourself. Firstly create a view that has a view page and view block and call the view anything you like. I have called mine views_embed_view (not very imagitive I know).  

Read more

Simple Jquery Examples

jQuery purencool website developmentjQuery is the framework of the future and its uptake across the internet is everywhere. Now the jQuery developers have created a mobile version for mobile devices. This tool saves developers time and the client money and the documentation for using it is widely available. Below is jQuery in its simplest forms, the examples below are what every developer uses when using this framework. Let's take some time to explain what it all means.

Read more

PHP how to increase memory

Increase memory using php.ini file

Increasing your memory for the Drupal Framework is important as this allows the application to work faster and then deliver the content to the user giving faster access to the content that you are providing. There are two ways to do this, if you have access to your php.ini file on your web server find the line that says the following.

memory_limit = 16M  ;

Most service providers will only allocate the default amount of 16 megabytes of ram. If  you change it to 64 megabytes of ram this will fix the issue.

Read more

Drupal Drush Commands

If you are using Drush you know how powerful this Drupal command line tool can be. It will deploy and maintain a complete Drupal website in seconds. Below is a selection of commands that are useful for a web developer, feel free to take a copy for your own use. For the commands to work you have to ensure that Drush is installed on your computer to find out more go to drupal project drush if you are using Debian it will be in the repositories. The drush commands below are in the directory of the drupal install when being used.

 

Read more

JavaScript and JQuery, What is the difference?

Have you ever walked down a hallway in the dark and found yourself lost? JavaScript and JQuery create the same sense of loss and confusion. When discussing JavaScript and JQuery people will say the funniest things about the two, one quote I heard a long time ago on the subject:

 JavaScript I hate, what we should do is get rid of it. But JQuery I love!

Read more

Setting up Xampp for speed

 

At times using Xammp on a Windows machine you need to find ways for Xammp to work faster. The easiest way is to change the speed of your PHP memory. To do this do the following,

Read more

What is a Version Control System?

When creating software members of the design and development team are constantly changing the code base as the software goes through each iteration but at times this can create an issue. Because of rapid development processes, files and code get change or deleted at a very constant rate. An example of this is Purencool Iticket the core grew and expanded so rapidly that each day there are a lot of changes. This creates issues for the development team as they can very easily be working on one part of a system and without knowing it completely break the software. So to stop this from happening almost everyone uses Version Control Systems to protect themselves.

Read more

Pages