You'll find the most recent articles listed first.
If you’ve ever used Go it’s hard to not find returning multiple values from functions conspicuously absent in other languages. In this case, we’ll look at a simple way to implement the same design pattern effectively in PHP. Why It’s Useful So why return multiple values from a function anyway? If you’ve never used Golang or a similar language which allows that, it may not be readily obvious. Most use-cases in Golang are centered around errors, so it’s very easy to check if a function encountered a error.
When developing server code in Go, it can be a bit of a pain to compile and restart the servers constantly. While some frameworks do this for you automatically, you may not be using such a framework. Then what? Thankfully, the solution is quite simple. It should only take a few minutes to get up and running with this, and all your future hacking on Golang powered servers will be a lot easier.
Secure, encrypted communications are more important now than ever before. As a result, it’s not uncommon to want to force all website traffic to be sent over an ssl connection. How can this be accomplished? Nginx Configuration This one a bit more difficult to track down, as there seem to be a lot of ideas out there. Here’s what I found works. Obviously, substitute your domain name in the example below.
While working on a project that does a lot of symlinking by default, the need to keep symlinks out of the Git repository became evident. Fortunately, it’s not too hard. The solution came from this post’s answers. Thanks guys! The Command Just run the following command from the base directory of your Git repository, and it will automagically add all the symlinked files to the base .gitignore file. for f in $(git status --porcelain | grep '^??' | sed 's/^??
For reference, this was done using Ubuntu 14.10. If it works for you on other versions, please let me know! First off, make sure to familiarize yourself with the official instructions for building Firefox OS, as we’ll be following them. Start off by following the prerequisites for Ubuntu 13.10 on the MDN site sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2 sudo update-alternatives --set gcc "/usr/bin/gcc-4.6" sudo update-alternatives --set g++ "/usr/bin/g++-4.6" You’ll also need various Android tools as well, so make sure they are installed.
Note - This post specifically mentions Google Analytics, but the principles would apply equally to any analytics software, like Piwik, for example. Time tracking is a pain. There are apps and services that can help. Nonetheless, it’s not the easiest thing to do. One solution I stumbled across lately is Google Analytics. It requires almost no effort and is quite accurate. How to Use Google Analytics for Time Tracking Simple insert the tracker into all pages and repositories/issue trackers you use.
If you’re developing with Cordova/PhoneGap/Ionic apps on the Ubuntu platform, chances are you’re using the cordova-cli package. For a while now, the nodejs and nodejs-legacy packages have collided around a singe man file. Unfortunately, the simple file collision can break the entire package manager and make it difficult to update anything. Add dkpg --force-overwrite Flag The solution is very simple. Just add the dkpg --force-overwrite flag to your apt-get commands. So this: sudo apt-get install cordova-cli becomes: sudo apt-get -o Dpkg::Options::="--force-overwrite" install cordova-cli Of course, you probably don’t want to type that all the time.
Anahita is a cool open-source social networking platoform written in PHP. It has a super-active, helpful community lead by Rastin Mehr. If you’re working on a website that’s powered by Anahita, you’ll want to keep up-to-date with the latest code changes via composer. If you’re not familiar with Composer, visit the project homepage to get up to speed. Updating the Anahita Codebase Updating the Anahita codebase is trivial with composer. Just cd into the root directory and run the following to get the latest and greatest: composer update Before you do that, though, read on.
Here’s how to solve another potentially tricky challenge when developing third-party integrations with the Anahita social networking platform. The current version of Anahita (3.0.x) uses Joomla and the Nooku framework to provide an out-of-the-box JSON api. It’s cool and it seems to work well. One neat (but hidden) feature is that it supports standard HTTP authentication. That’s super, as there’s no need to worry about using cookies for authentication, allowing for more or a classic stateless REST experience.