Programming
Converting DateTime.Ticks into a Unix timestamp in PHP
I needed a way to convert the number of ticks from the DateTime.Ticks property in .NET into a Unix timestamp in PHP. So I wrote up this solution that makes this possible. The solution works by taking the number of ticks that I want to convert into a Unix timestamp and subtracting it with the number of ticks of the Unix epoch.
To figure out the number of ticks of the Unix epoch, I used C# (it is possible to do this in a different .NET language) using these two lines of code to find the number of ticks of the Unix epoch in a simple Console Application:
How to Revert Your SVN Repository on Assembla
There is no simple way to revert your repository to a previous revision on Assembla. However, a reversion is possible by following these steps.
First, export the SVN repository in your space. This can be done under the Import/Export section of your repository. It’ll take a minute for the dump to be created. Once that has completed, download the repository dump.
Then, extract the contents of the ZIP file to a temporary directory, then run the following commands in the temporary directory:
Ruby on Rails Sucks? I Don't Think So
I have been playing around with Ruby on Rails for a while. You know how to program and know the commands for it, you’ll think it’s cool. Ruby on Rails is a MVC framework for the language Ruby. MVC stands for Model-View-Controller. The model is the database logic, the controller is the application logic, and the view is the presentation logic. Using this style, it keeps things organized.
People will think Ruby on Rails suck because they don’t know how to catch on to it. I admit, I was originally one of them, until I read Agile Web Development with Rails, Third Edition (Amazon). This book showed me how powerful this framework was and how much it was capable of doing. Doing validations is a breeze, embedding variables and Ruby code is a breeze in the views, routes are easy to configure (no .htaccess), database migrations to keep things in order, ActiveRecord to ease querying, updating, and inserting (no more SQL queries), and there’s so many other cool things with it. There is even loads of plugins on the Internet and on Github that do kickass things.