I started using C# a couple of years ago, and my favourite part of the language and integration by far is LINQ. The ability to write natural code which can be fired as a database query or series of optimised collection manipulations is impressive, but mainly just nice to work with.
The problem is that using a nice syntax such as the ES6 arrow functions, (s => s.active), would require us to craft an object to pass as the first parameter during execution. Naturally, determining this before the function is run is very difficult to achieve dynamically. Instead, I opted to use Esprima to derive the results statically. As such, while the evaluation is conducted from a function, such function is never actually called.
Data-First development is an idea that I’ve had for a while and it’s the way I approach most development projects these days. I’m sure that you will have done it too, but just never quite thought about it.
The way I see development is to start with the data. At the very beginning of a project it’s important to get the specification right, and as part of that – design the data store and models. That makes sense, but once they are designed they are inherently forgotten about until they need to be changed.
Instead, I propose a simple workflow that at the start of the project admin interfaces to manage the data is the first thing that is built. There are a few reasons.
Amateurs sit and wait for inspiration, the rest of us just get up and go to work.— Stephen King
Dropbox is pretty awesome, and enhancing the Automatic WordPress Backup script to send the files to Dropbox is fairly straight forwards.
This tutorial is going to give us an off-site backup of anything we want. That’ll occur automatically, like magic. :D
As usual, ssh into your server.
I’m a huge fan of Trakt, but I know people who are tempted by VIP solely for the widgets. Now that’s great, but those widgets probably aren’t worth your $5. If supporting websites is important to you, this is probably not the post for you. It’s likely that this method could break in the future, keep that in mind!
We’re going to use our server as a bit of a proxy.
Here’s a couple of examples of what we’ll be creating (they’re live).
Migrating WordPress from one host to another can seem daunting, but unless you’re changing the domain name it’s actually fairly straight forwards. For this tutorial, I will assume you are NOT changing the domain name.
There are 2 important parts to any WP installation, the database and the filesystem. In particular, the wp-content directory. In order to speed things up, my advice is to install the WP software as new (forcing an update to the latest version). Feel free to copy old system files if required, but it’s mostly just a waste of time and bandwidth.
Optimising WordPress is a fairly straight forward process, and in doing so it’s possible to squeeze a serious amount of speed and power out of a cheaper server.
Go ahead and ssh in!
Cron is a system that runs programs (or commands) at scheduled times. WP Cron is the WordPress implementation that mimics this. Due to the necessity for WordPress to be compatible on various systems it’s not, by default, done “natively”. Instead WordPress triggers the appropriate hooks the next time the website is accessed. It’s possible to fake this with tools like Pingdom which hits your site every minute to report downtime, but we’ll go ahead and create a full cron system.
The first step is to disable WP Cron, and it’s crazy simple.
Scroll down and insert this line (near the bottom), feel free to add that other command if you are missing it.
define('FS_METHOD', 'direct'); define('DISABLE_WP_CRON', true); /* That's all, stop editing! Happy blogging. */
Now we can edit the crontab, Linux’s built in cron system
Install all the WordPress
As part of this installation guide I’ll be showing you how to install the cli, setup the database and configure wp. It’ll be a relatively long post, however by the end you’ll have a working WordPress installation. Without further ado!
The CLI is incredibly useful, it allows us to install WordPress, take database backups and anything else you might want to do in the web interface. Installing it is simple! From a server ssh connection:
I always like to work out of the temp directory when downloading and installing files, just incase I mess up or leave a file behind.
So, what we’re going to want to do is download the cli installation script.
Self hosting an email server is generally a bad idea. I’d recommend using Google Apps gmail service for hosting one. And DigitalOcean has a button which will setup the required network settings too! However, for sending email it’s sometimes pretty useful, we’ll setup sendmail for sending only.
sudo apt-get install mailutils
Choose “Internet Site” when prompted. And enter your domain name as the system mail name.
The way to get started is to quit talking and begin doing.— Walt Disney