Apache Localhost Rendering Slowly?

Is your localhost taking longer than expected to load?

A possible quick fix is to edit your httpd.conf file and set ‘ServerName’ to 127.0.0.1:80 . This can make the difference between millisecond load times and crying while Apache tries to load.


# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
ServerName 127.0.0.1:80

We’re Back / Moving Forward

So I’ve truly neglected here, my original space on the internet. . It’s been almost two years since my last post, which was really just a code snippet.

So moving forward I’m going to be blogging about completely different topics that I haven’t blogged about before. .

For my current subscribers (it’s hard to believe I still have subscribers) you may want to unsubscribe and decide if this is something you want to subscribe to moving forward.

So whats happened?

Well, a lot has happened since I’ve last posted on here. It’s even kind of hard to timeline the last two years myself. I started my own web development company in Kilkenny (coder.ie), I did that for around a year and a half.. Learned a lot of valuable lessons throughout doing that. Got myself the funds needed to get to Canada (barely), now I’m living in Vancouver and working at Motbot .

I love my new job, I don’t think I would go back to owning my own company anytime soon. Landing a job after landing in Vancouver was a breath of relief and I really lucked out ending up with a company that are doing some amazing stuff. My co-workers are really experienced in their respective fields and I don’t think a day goes by where I don’t learn something new. It’s so refreshing after the stress of working on my own for so long  and nearly losing my love for programming. I think that’s partly why I stopped posting on here, when I finished working the last thing I wanted to do is use the computer any further.

I can’t see myself returning to Ireland if I can work out staying here. Canada is an amazing country and Vancouver is just such a beautiful city.. So much is better here, its hard to even put into words, I’ll try over a series of articles! :P

What are my future plans? 

I think this works better in list format:

  • Improve as a poker player 
    Yes we’ve gotten very into poker in the last year playing mainly online tournaments, I won’t really get into this much here as there will be more content on it later.
  • Create a game using Unity
    Anyone who knows me knows I’ve always wanted to create a game, that’s what originally got me into programming. I’ve tipped my toes into a few games along my way, but I’ve never actually created my own game and had complete creative control. That’s the next plan. I’m going to create a 2D game over the coming months and document my progress here along the way.
  • Learn C#
    Kind of ties into “Create a game using Unity” since C# will be the language I use most.. I never did get around to learning Python, hopefully that doesn’t happen here, though its more unlikely since I’ll actually have a use for it.
  • Live Healthier
    I’m probably the picture of unhealthy living at the minute, I’ve been trying to make small changes to change this and hopefully all these small changes will turn into massive changes. Like quitting smoking, we’ve just been putting off doing that forever!!

So that’s all I have for now, I hope this clarifies what way content will be headed in future!

How To – Control Your Computer with an Xbox Controller


Today I’m going to walk you through setting up an xbox controller to work on your computer and control the mouse / keyboard.

First your going to need an Xbox Controller that works on Windows.  If you already have an Xbox controller you can just pick up one of these receivers. (Both links to Amazon, you can  find on  eBay cheaper).

Next you’ll need to install the drivers for the controller. You can find them on Microsoft’s website here.

Now you should be able to connect your controller to the computer and play any games using it. However you can’t use it to control the mouse yet. What we will need to do next is download JoyToKey from here. I went with the latest Beta version however you can also download the stable (v 4.6 at time of writing).

The second last step is to download my config and shortcut to the on-screen keyboard put the configuration in the folders shown and run JoyToKey.

The last step is to enjoy being lazy! ;)

WordPress – Shortcode in PHP files


So in WordPress with plugins etc. you end up using shortcode in posts to keep things simplier, an example would be if you want to display a gallery you would just use:
[galleries id="1"]
However trying to this when your outside of the “WordPress Loop” [in your theme files usually] you will hit the problem that WordPress won’t parse the shortcode. So whats the soloution? Super simple just append the following to your shortcode:
echo apply_filters('the_content', '[galleries id="1"]');
Presto, it works!

To read up more on shortcodes in WordPress click here.

Why I’m learning Perl

So this post may not be to everyones taste, its more a post to remind myself why I’ve decided to learn Perl. If anyone doesn’t know I already know PHP and some Java.

Perl is a programming language, It’s Object Oriented, simple to learn and very powerful. Perl stands for: “Practical Extraction and Reporting Language” but others have come up with many more interesting and colorful names for it;
Perl is “the little language that could” it’s designed to be able to do as many tasks as possible in as little time as possible.

“A good perl program is one that gets the job done before your boss fires you.”
Larry Wall, the creator of Perl.

Perl is an Interpreted language, so you don’t have to compile it like you do Java, C, C++ etc. For fast development work, that’s a godsend.

Perl has been successfully used for a lot of diverse tasks: text processing, system administration, web programming, web automation, GUI programming, games programming, code generation, bio-informatics and geneological research, lingual and etymological research, number crunching, and testing and quality assurance.

Perl Pros:

  • Cross Platform compatability. A perl script for linux/unix will work just as well in windows and vice versa, and the only exceptions to that rule are those dicticated by the operating system itself. (for example file paths are different in windows and unix.)
  • Online support. Perl has been around since the early 90’s, its exceptionally well known and thousands of tutorial and help sites abound on the internet.
  • CPAN.org, a massive collection of perl modules that can do almost anything, someone has usually done the work for you.
  • Taint mode, this helps you to write secure code by not trusting any data provided by the users until you have tested and declared it safe.

Perl Cons

  • Speed. Apparently with a very large program [Like word or something] the  sheer size of it would make it extrememly slow to compile at runtime.. This is the only Con I’ve found about Perl!

 

PyroCMS – CMS on the CodeIgnitor Framework

So lately I’ve been playing around with PyroCMS, for any of you who don’t know about Pyro, its basically an open source content  management solution thats based on the CodeIgnitor framework. What does that mean you ask?

  • MVC design pattern. (Model->View->Controller)
  • Security,  Cross-Site Request Forgery protection, XSS filtering and very secure password encryption.
  • Caching, in order to achieve maximum performance.
  • Translated into 16 languages!
  • Extremely lightweight!
  • Support for modules, themes, plugins and widgets!
  • Multi – Site Manager (In Pro Version £45 )

Really it takes the pain out of  making your standard websites, you’ll have an area where the client can update their website in a simple environment  and thanks to ‘permissions’ you can be sure they won’t mess anything up!

Of course there is always going to be a stage when your better off without a framework, but for projects that it will work for, PyroCMS will save you a BUNCH of time!