Jul 27

Sending Messages to Slack From Go

Slack is a great communication tool for teams of international developers who need to keep in sync. I personally use it every day and I find it to be much better than some of the other alternatives out there. While working on another project, I came across the need to send notifications to Slack from my Go application. Utilizing Slack’s awesome API, I wrote a quick package to easily send messages to a Slack channel.

GoSlackOff was born! To use it, simply create an instance with your Slack username, hook token, the default username to post as and the default channel to post in:

And then call the  SendMessage()  method. You can also override the channel or username for each message.

The SendMessage()  method will return a success boolean and the HTTP response object from the API call.

For more information, check out the README on github!

May 5

Titanium Alloy as a mobile platform

appcelerator-titanium-cover

Back on track now after the last, somewhat off-topic, blog post! Today I want to talk about a new platform I’m using for work called Titanium. What it does is it allows you to create fully native mobile apps using JavaScript as the language.

Why this? Why now?

Well, it’s not the first framework to provide cross-platform development tools for deploying the same codebase across multiple devices. Phonegap has been doing that for years! And up until very recently, Phonegap has been my go-to-guy for easily creating mobile applications without the nightmare of Objective-C based programming or even worse, Java based coding. What happened was I had just finished programming the app for iOS; it looked beautiful and it functioned perfectly. Transitions were smooth, pages loaded quickly, basically everything was awesome.

Sure enough, when I go to port it over to Android to make sure it works the same, it doesn’t even look remotely the same let alone function properly. I was getting probably 2fps max on page transitions on top of the already ridiculous 5 second delay between a tap on the screen and a reaction of any kind from the UI.

I was disappointed and frustrated. I had just spent the last 2 months building this beautiful app on iOS just to have it look and function like crap on Android. So, after many long hours of research and some help from some friends, I found Titanium (actually my friend had mentioned it a while back but I forgot about it :P).

So far so good!

I’ve been using Titanium for a week now and all I have to say so far is that it is amazing. You get the performance and the feel of a native app, all while maintaining that cross-platform portability that Phonegap brought to the table. The best of both worlds I think! It’s incredibly easy to use and the results outperform any Phonegap or “hybrid” application out there.

I’ll be working with Titanium for the rest of this week and I will post another blog post shortly with some thoughts 🙂

May 4

Neat NodeJS Plugin

NodeJS

I found this neat plugin today for Node.js development called Nodemon. What it does is it monitors the files you’re working with and restarts the server whenever a change is made. This will be particularly useful for those who are sick of hitting CTRL + C, UP ARROW, ENTER each time they save a file. On top of that, if some change is made to the script that causes it to error and crash, Nodemon will display the error and wait for you to fix it before restarting. This prevents infinite looping if errors occur!

To install Nodemon, just use the built in Node Package Manager, npm

Once it’s installed you can run it as you would normally but substitute the node command with nodemon so nodemon some_application.js. As an added bonus, cd to your work folder first so it can monitor all folders and files of your application.

I found this to be exceptionally useful during development and saves a lot of time!

Apr 6

Awesome PHP Service Checker

PHP

I recently found this neat dashboard company called leftronic and they provide a way for you to push data to their dashboard and customize it they way you want. So what I did was I decided to set up a service status page for my gaming forum so that the users will know if something goes down. Well as a result I came up with this really neat way of check if a service is running on a certain port.

Hopefully this can come in handy 🙂

This was a quick and easy way to test services on different ports 😀

Mar 30

NodeJS + Socket.io Random Freezing

So I recently found this out the hard way… if you are running a socket.io service on a non-standard port and have a firewall (which you most likely do lol) then you may be experiencing random freezing. TO MY KNOWLEDGE, this is caused by the UDP port being blocked by the firewall.

I was experiencing this issue and I unblocked that port in the firewall yesterday and I have not seen my app freeze yet! 😀

YAY!

Points for super short blog entry lol but just in case anyone can benefit from this 😛