Archive: page 7
The PHP project as a whole has been migrating to use git as its SCM of choice. This includes the core code and some PECL extensions such as BitSet and the sources for the PHP.net web properties like wiki.php.net Well now the PHP team have helped me to migrate the source of ssdeep to git, which means it is now also mirrored (where you can star it) to the official PHP github account. Read more ⇒
JavaScript started life as a project named Mocha created by Brendan Eich at Netscape in 1995. By the time Netscape Navigator 2.0 was due for release the language had changed names twice becoming LiveScript and then, finally, JavaScript (JS). Originally Netscape were considering a derivative of Scheme for client side scripting, but swept up in the buzz of Sun’s Java at the time management stated that the language must look like Java. Read more ⇒
Create a Google Talk bot with Node.js: Part One
Programming a chat bot was once the domain of the hardcore hacker tapping packets as they passed over the wire from proprietary client applications to closed source servers, but not any more! With the open Extensible Messaging and Presence Protocol (XMPP) once closed networks are becoming accessible to the rest of us. I selected Google Talk as it is probably the most well known implementation of XMPP and it is easy and free to sign up for, but Windows Live Messenger, AIM and Skype all support it to some extent. Read more ⇒
Tags are quite a simple aspect of git, but there are a few things that a lot of people don’t know about. These shortcuts will make it quick for you to tag and manage those tags in your git repositories. Probably the most common use of tags is to note when a version of the software the repository is tracking is released. Usually this will be something like ‘1.2.8’ if you are sticking with SemVer. Read more ⇒
Idiorm and Paris 1.3.0 released - the minimalist ORM and fluent query builder for PHP
Idiorm is a PHP ORM that eschews complexity and deliberately remains lightweight with support for PHP5.2+. It consists of one file and primarily one class that can easily be configured in a few lines of code. There are no models to create, no convoluted configuration formats and there is no database introspection just a simple PDO connection string. However, having said this, Idiorm is very powerful and it makes most of the queries PHP applications require pain free. Read more ⇒
Unicode shortcut in Netbeans for React/Curry
In some of my code I use a PHP library called React/Curry and to save typing it uses a unicode ellipsis (…) for a method name. Yes, that is right unicode method names can be legal in PHP! <?php $firstChar = Curry\bind('substr', Curry\…(), 0, 1); See I told you so! Well that is great, but how do you type a unicode character into a Netbeans document? To save having to constantly copy and paste the … character from a symbols list I have setup a very simple macro in Netbeans to print the character for me. Read more ⇒
Navigator: Geographic calculation library for PHP
Navigator is a PHP library for easily performing geographic calculations and distance unit conversions on Earth or any other spheroid. Currently it supports distance calculations between two coordinates using Vincenty, Haversine, Great Circle or Cosine Law. By default it uses the most accurate, but computationally intensive: Vincenty. To calculate the distance between two points on Earth in metres it is as simple as: <?php use Treffynnon\Navigator as N; $distance = N::getDistance(10, 81. Read more ⇒
Force URLs to lowercase with Apache rewrite and PHP
Canonical pages are an important aspect of maintaining a website and ensure that search engine rankings are not affected by any duplicated content. In *NIX based systems file names with varying capitalisation are treated as separate files. For example filename.txt is not the same file as FileName.TXT. This extends into the world of Apache where URLs are also case sensitive. So that means that we really should pick a case for our URLs and force all browsers to redirect to our chosen scheme. Read more ⇒
Installing curses: sudo apt-get install libncurses5-dev fish is now installed on your system. To run fish, type ‘fish’ in your terminal. To use fish as your login shell: add the line ‘/usr/local/bin/fish’ to the file ‘/etc/shells’. use the command ‘chsh -s /usr/local/bin/fish’. To set your colors, run ‘fish_config’ To scan your man pages for completions, run ‘fish_update_completions’ Have fun! Read more ⇒
NetBeans with jVi vim bindings
I love vim and its very handy shortcuts, but I also like to be in a GUI IDE for most of my development. Thankfully there is an answer; add vims keybindings to the NetBeans environment with jVi. Once you have Netbeans 7+ installed you can install jVi by going to Tools > Plugins > Available Plugins and searching for jVi. Select jVi for NB-7.0 Update Center and click Install. Now click the Reload Catalog button and wait for the updates to stream in. Read more ⇒