Skip to content

Instantly share code, notes, and snippets.

View richjava's full-sized avatar

Richard Lovell richjava

View GitHub Profile
@richjava
richjava / php-password-hashing
Last active August 29, 2015 14:10
PHP Password hashing for PHP 5.5.0 and less
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PHP Password hashing for PHP 5.5.0 and less</title>
</head>
<body>
<h2>PHP Password encryption for PHP 5.5.0 and less</h2>
<p>For PHP versions greater than 5.5.0, there is an in-built hashing method (see <a href="http://php.net/manual/en/function.password-hash.php">password_hash</a>), but you could still use this method if you wish.</p>
<?php
@richjava
richjava / getting-started-on-composer
Created November 23, 2014 23:31
Getting Started on Composer
*************Install Composer on your computer*************
If you are not behind a proxy, skip this section - Composer has a windows installer executable which makes it easy. If you are behind a proxy, you can do the following:
Go to Environment Variables (start menu "env"+Enter)
In "User variables..." section (the top section), click "New".
For the variable name, write "PATH".
For the variable value, paste the path to your php executable file (in .../xampp/php).
Click OK on this dialog and OK on the main Environment Variables dialog.
@richjava
richjava / netbeans-git-helloworld
Created November 20, 2014 23:11
Netbeans Git HelloWorld
************************Create a remote repo************************
Log in to your Github page > Repositories > New > Write repository name (i.e. HelloWorld) > Write a description (i.e “My first project on Github”) > Leave “Public” checked > Check “Initialize this repository with a ReadMe”. > Create Repository.
On the repository details page copy the clone URL (in the right column textbox) to clipboard.
************************Create a new project on Netbeans************************
Call it HelloWorld (the name doesn’t need to be the same as the Github repo, but it makes sense to do so).
************************Create a local repo************************
@richjava
richjava / getiing_started_with_git_with_proxy_on_windows
Last active August 29, 2015 14:10
Getting started with git with proxy (Windows)
The following will get you started with git on Windows behind a proxy. You will need a web project set up on your machine and a Github account with a repository set up which you will send files (push) to.
*************Open Git Bash*************
If git was installed by your administrator to allow you to open git bash at a certain directory by left clicking on the directory and choosing "Git Bash Here", then skip this part and just open git bash on your project directory.
In your file system, go to where git was installed on your computer, i.e. C:\Program Files (x86)\Git
Right click on Git Bash > Send to > Desktop (create shortcut)
Double click Git Bash
@richjava
richjava / phtml_in_netbeans.txt
Created November 9, 2014 23:03
Creating .phtml files in Netbeans
It is common practice to use .phtml files for view-related files but Netbeans (as at version 8.0) doesn't have out-of-the-box functionality to directly add them to a project. However, Netbean's Templates allow you to specify this functionality:
Firstly, create a folder called "Netbeans Templates" on your local machine with two files inside: "PHTML File.phtml" and "PHTML Web Page.phtml". Customize these files to your liking.
Go to Tools > Templates > PHP > Add, and then choose your file (do this for both).
The new item will be added but it will have the .phtml extension in the name (which we don't want). You can remove the extension by clicking on the file name and then clicking the Rename button.