Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Hacker Games, JavaScript

JavascriptBattle

Lately I’ve been playing at JavascriptBattle, which is

a fun and engaging web application intended to make artificial intelligence (AI) design accessible to all. Every day, your code will be pulled down from your “hero-starter” repository on Github. Your code (along with every other user’s code) will be run daily, behind the scenes, in our game engine.

Basically, you write JavaScript code for your hero in order to instruct him how to behave when for example his health drops to a certain level, or when enemies are close, etc. and then you participate in a daily battle. They have various stats, and as it turns out I’m currently on position #3 for average damage dealt, yay me!

JavascriptBattle

 

Anyways, it’s cool so feel free to check it out and take me down from the pedestal :P. If you happen to like these “hacker games” then do checkout the one I made for my university project back in the old days 1415131129_smiley-evil.

Hacker Games

Topcoder Scavenger Hunt

I just competed (and finished! – I’m Hitman666) a Topcoder Scavanger Hunt.

topcoderScavangerHunt

Anyways, you have the instructions on how to play on the link above. I’ve really missed these kind of “hacker games”, like back in the days I was very active on hackits.de, but that site is long down now. Anyone playing similar games today, which you can recommend? I made my own for the project on university: http://nikola-breznjak.com/challenge/.

The questions were quite cool (no, no answers here, you’ll have to research it yourself):

  • How many ‘Albert’ monkeys died in the US Space program?
  • What was the original name of Nintendo’s Super Mario?
  • How many female fighter pilots were there in the original Star Wars trilogy?
  • How many different combinations of coins are possible for the US dollar?
Stack Overflow

How to get Disk Space Usage and Monthly Bandwidth Transfer from cPanel to my website in PHP

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

My quesiton was:

I’m wondering how can I show (get) disk space usage and monthly bandwidth transfer on my website in the same way as it’s shown when I login to my cPanel account. Is there an api from cPanel for this or is this a general method to do so? I’m using PHP.

This answer, by user richsage, was:

cPanel/WHM has an API which offers access to both the elements you’re looking for. See the API docsfor more details. The bandwidth and disk usage modules in API 1 output HTML, however API 2 has anaccount summary method which will return the diskused parameter in the appropriate format (XML/JSON as requested).

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak