Tag: Server

ECMAScript 6 has been Approved

In the last several days I have been planning for a multi week work trip to India. In fact I’m writing this on the plane to London as it is the first chance I have had to write anything recently.

ECMAScript 6 has been approved!

It was approved on the 18th of June and brings with it many amazing new features. I’m sure I will be writing more about this in the future.

I’ll be celebrating 2 days late and over the Atlantic, but I will be celebrating none the less.

Cordova and Session Cookies

As of Cordova 5.2.0 on Android 5.1 cookies are working.
I will be investigating other platforms, like iOS, soon.

I’ve talked many times about my love of Cordova. I like how I can use my existing knowledge and code to build a mobile application with additional abilities than a web application. While I know how to a write native Android application, I still prefer to do my initial prototyping and launch in Cordova.

I honestly like everything about Cordova aside from the fact that you can’t use cookie based sessions.

In this post I will show you how to do so in Express 4 using jQuery AJAX calls and some simple code.

Continue reading

Node.js Best Practices

I’ve recently been working on a lot of Node.js projects, for myself, with my students, and for national organizations. Because I’m a University instructor I’ve been getting a lot of questions about what the best practices for Node.js are from every project I’m involved with. I’ve worked with Node.js for years and know all the best practices myself, but I had never seen a list that explained the best practices to my satisfaction. So, I have put one together taking all the best practices agreed on by the community and explaining why each practice is the best way to write Node.js code.

If you want to improve these best practices in any way please don’t hesitate to create a pull request to the GitHub repo.

Here we go.

Continue reading

Microsoft has Actually Made a Great Product, TypeScript

I’m fairly vocal about my opinion of Microsoft products. They have never made a single that is better than the competition, except maybe C#, but only maybe.

IE vs Safari vs Opera vs Chrome vs Firefox: Chrome or Firefox win

Office vs iWork vs LibreOffice = iWork wins

Windows vs OS X vs Linux = Linux wins with OS X a close second

However, they have finally made a product that is I would use over the competition, and most developers I talk to agree.

Continue reading

Personal Cloud Drive with ownCloud

If you’ve ever used Dropbox or Google Drive you know what cloud based storage is. It’s a hard drive located somewhere on the internet for you to store and share your files.

But what if you have terabytes of files, or a preexisting server infrastructure at your work or house? Are those solutions really the best? Is there a better self hosted solution?

There is and it’s called ownCloud.

Continue reading

Making Desktop JavaScript Apps with node-webkit

Update: node-webkit is now called NW.js and uses io.js and Blink instead of Node.js and WebKit. All other information is still correct.

JavaScript can be run in a browser normally, on a server with Node.js, and on mobile devices with Cordova, but where else can we use JavaScript to program?

Well, plenty other places, but the last big place to write programs is the desktop and today I’m covering writing desktop JavaScript applications with node-webkit.

Continue reading

Remote MySQL Connection Access

When moving a site from one server/host to another it’s often necessary to have both servers/hosts share a third server’s database. This is necessary because as the DNS change propagates around the world some user’s ISP may send them to your old server and some may arrive at the new server.

If you had two independent servers running two instances of MySQL the records in the database won’t match and some users will never be on the new server. This is especially a problem if you’re running a subscription based website. You merchant may have already processed their account information and confirmed them on your site, but wait, were they confirmed on the old server or the new one?

Using a shared database allows users who sign up to your site through the old server to be added same database as users who sign up through the new server. But MySQL doesn’t allow this to happen by default. It thinks that any incoming request from an outside connection is a security threat.

The internet is usually a great place to find tutorials, especially relating to programming. However, configuring a MySQL database for remote connections seems to be a poorly documented thing online.

With that in mind, here is a short explanation of how to configure MySQL to allow remote connections.

Note: this will not work on shared hosting.

Continue reading