Tim Habersack

Where I put my things..

The Dishonor of Kaln

Jan 16th 2017
"Quickly, my Queen, we must away!"
the white-cloaked young Knight calls;
sounds of battle grow ever close
down grey stone-pillared halls.

"Protect my Love, and keep her safe"
ordered his Sovereign Lord.
Yet rash heart yearns to stand with King,
to wield unbloodied sword.

Red-robed Queen walks with hurried poise,
guards try to not show fear,
all stop and as one group they froze,
at unearthly scream quite near.

Swiftly they go through stone-arched gate,
towards stables where escape await.

Within stable, hearts fill with hope,
welcome scent of fresh straw.
As all make ready to depart,
Knights fervor does still gnaw.

Escape in sight, the Knight did speak,
"I must defend my King."
The Queen upon her horse looked down
and sadly touched her ring.

"If you must, you must."she quickly said
and spun around her steed.
With clear command, "Onward!" she spoke.
They rode away at speed.

Towards throne room and King, Knight does head,
Where glory, honor lie ahead.

Round last corner, young Knight turns,
into a ghastly scene.
Knights and guards litter the floor,
Of Throne room once serene.

Dark-armored figures press forward,
toward fearless sword-drawn King.
As Knight rushes towards desperate fight
Kings sword halts in mid-swing.

He shouts "You should have kept her safe!"
Face shows his trust betrayed.
Distracted thus, his heart is pierced
Ran through by black-swords blade.

The young Knight pales; what has he done?
Towards Queen and duty he doth run.

Footfalls echo in empty halls
as Knight retraces route.
With sword in hand, his keen eyes scan,
aware of foes about.

With caution peeks in stable door,
no enemies inside.
To Queens escape, southern moon gate.
Upon black steed he rides.

At silvery gate he leaps from horse,
the steed, in protest neighs.
He runs past bodies, broken spears.
In shock he stops, dismayed.

On road, Queens robe is torn in parts.
In tatters, matching Knight Kaln's heart.

#poetry

How to get the final url after redirects

Nov 14th 2016

Sometimes, you have a link. And you want to save the actual, final url that link points to. A great example of this is trying to archive something on twitter. You'll want to store final urls for ones that are tweeted, not their url shortened one.

Anyway, I wrote this really quick in #php and it works!


$d['initial_url'] = 'https://t.co/NOKpf0iHpR';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $d['initial_url']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $d['initial_url']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($ch);
$d['final_url'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
print_r($d);

This outputs:

Array
(
    [initial_url] => https://t.co/NOKpf0iHpR
    [final_url] => https://tim.hithlonde.com/2016/announcing-js-space/
)
Nov 8th 2016

I just installed Counter-Strike: Source, and I am not sure why. I think it's because I want to see cs_italy again and hear that music just one more time..

Nov 7th 2016

I spent my lunch break filling out my ballot. There are still a couple local measures I need to research more.

Oct 26th 2016

Woke up this morning and everyone in my family is sick, including me. Definitely taking a sick day.

The Shining Blade

Oct 14th 2016

Within the stone crypt,
light glinted from shining blade,
defying times curse.

#haiku #poetry

Sweden to give tax breaks for repairs

Sep 27th 2016
The Swedish government is introducing tax breaks on repairs to everything from bicycles to washing machines so it will no longer make sense to throw out old or broken items and buy new ones.

Source: Article on The Guardian

This is such a great idea! It could be a challenge since some appliances are designed to be throw-a-way, but maybe incentives like this for repair could help some new manufacturers spring up and make some appliances designed to be repaired.

Immersion in Games

Sep 6th 2016

I was thinking about immersion in games, and I remembered about one of the first immersive titles I played: Myst.

Now, you can hate or love puzzles, and that's fine. But you can't deny the the library in Myst was one of the most amazing things ever.

myst_bookshelf

My older sister and I would sit there, and read these digital books while 'in' the library. Some of those books seemed very long, 20+ pages. So we'd be sitting there, and when you're done reading it goes back on the shelf, then you're back in the library.

There is something about reading books, or something similar while already IN a game, that makes that game area feel more real. You've been there. You've read books there.

It's a really neat effect, and one I want to use in the future.

Trainwrecks; Two Reasons Why Prototyping Ideas is Beneficial

Jun 8th 2016

Main photo from versageek.

Like many elements of software design, I feel like I figure certain things out later than my peers. (Thanks Imposter Syndrome!) In this case, I'm talking about the value of prototyping. Of knowing you will be rewriting this code you are making.

For the longest time, forever really, I have been against this. Sure I would make mock-ups of some elements, but I'd never write disposable code. After all, I've been doing this long enough that I can avoid all the pitfalls and design an elegant solution after planning. Oh goodness, so much planning. All my well-thought out code would be perfect and I'd never have to change it. THIS NEVER ACTUALLY WOULD HAPPEN.

What actually happens is you paint yourself into a corner, leaving you with tons of refactoring if you need to change directions.

I'm going to give an example of what I mean.

I have been working on Nickelpinch, an open source finance and budgeting web app for a while now. I've been making iterations of the basic functionality since 2006. (aaahhh!)

In 2014 I decided to rip it all up, and make an actual, real version other people would want to use. I went with Laravel (a modern framework) because it was the best for PHP, however I didn't know it very well. So I spent cycles getting up to speed in that. Then I spent lots of time planning the UX/UI and made templates in straight HTML, that I could use later. I started with what the user would start with; account creation and login. I kept going from there.

Hours and hours of time before I got to actually begin implementing my new ideas for handling budgeting and adding a person's purchases into the system. Once I had that in place, I started testing it all myself. It was bad. Like, super non-intuitive. I kept getting mixed up when using it, and I made it!

There were some design assumptions I'd made that were bad and I had to refactor. Those data models I spent hours on; beautiful structures of normalization? All had to be modified. Which meant all my user functions needed to be altered everywhere, etc. It was a huge time sync.

I'm almost done now (yay!), but I ended up wasting lots of time. (Boo)

If I had made a shaky prototype, no concept of user accounts, sign ups, etc just a test of the core of the app, I would have seen the flaws. I would have saved at least 80 hours too. :/

So there is reason #1 for making prototypes:

It will save you time over all, especially if you have UX elements.

Another reason, and this one just came to me several days ago, is what I call pre-fatigue. It's when I think of an idea for an app or game, and I see the roadmap ahead of me and it's so long I despair and do not even start. I'll explain via another example.

I am designing a sci-fi game, something akin to a turn-based 2D Elite. I want MMO support, I want mobile and system apps for it, I have an ambitious design with lots of untried gameplay methods, etc. Here is what I was planning, from a technological standpoint:

  • Core Game Logic in Go, which would be my API
    • Go is great for this, because it's crazy, crazy fast, BUT it is more C-like and it takes longer to develop in than some scripting languages
    • I have never used Go, will need to learn it. Huge time investment.
  • Game Client in melonJS, a lightweight HTML5 / JavaScript game framework
    • This would be a mostly empty UX/UI shell that the API would shove content into.
    • I am fairly familiar with JS, but this is a huge step in complexity for me. Another huge time investment.

Just looking at that bums me out. It's a ton of work and lots of that stack I need to learn. Also, my biggest fear; what if, after all that foundation is in place the core game or UI doesn't work well? Shoving all those really good intuitive warnings aside, I started..

I started learning Go, and dove into galaxy generation. I actually made modest progress at this, see my totally working script. It's so fast!

Then I realized, well what if people want to play single player? Having one huge chuck of game logic in Go for the API, and duplicating it in JS would be a nightmare.. I know! I should write the API in JS too, and learn yet another tool, node.js for my server-side JS API.

At this point you should be screaming "Just stop it, stop!". But I didn't stop. I rewrote my galaxy generation + some basic UI elements in pure JS (That means no frameworks or helpers, since I wanted to up my JS skills). This took a while, but I ended up making JS-Space, which is pretty neat.

However, he farther I was getting into the UI elements, the more I was beginning to despair. "What if I spend 40 hours getting this component working, just to totally toss it?". So I stopped development.

I basically have been at this spot for 10 months. Then! I had the thought, "Dude, just make a single player tech demo of the combat. JUST that to start." I saw I was making the same mistake I made with Nickelpinch; building the entire city infrastructure before seeing if it was a viable location.

What a difference it's made to my outlook! Instead of toiling away for years on something before I have anything to show for it, I could have something a little nifty in maybe 2-3 months! Suddenly I am full of energy to tackle this!

That is the second takeaway:

Small prototypes give you something to show for your work, and you get that morale boost of having something to show for your time spent.

So if you are starting a project that has a lot of untested elements, just make tiny tests of each of those. Don't worry about ANYTHING other than testing that one thing. Get all your untested theories tested, see how they really feel when using them, THEN go back and make it the right way.

Announcing JS Space!

Jun 2nd 2016

I am so excited to share this with you!

From the README:

JS-Space a tool/game that will generate a mostly-realistic galaxy from a seed, then let you navigate around it to view the various stars within the galaxy. It's designed to work well on computers and mobile devices.

How to Use:

  • Use the arrow keys on screen, or on your keyboard to navigate about the galaxy.
  • Click/tap on a star to view it's details.

Links:

Some Neato Features

  • It's Open Source!
  • Only vanilla JS was used, no jQuery or anything else.
  • Alter the config.json to change the number of sectors that are generated, min distance between generated stars, etc.
  • The Sector View window is calibrated on page load, so on your phone try loading it in portrait vs landscape mode to see different layouts.
  • All the star details are mostly realistic main sequence type stars, with appropriate percent chance of existing. (Class M are much more common than class A, for example.)
  • You can pass in a seed via the URI. For example: https://js-space.graviton.systems/?seed=reverse_the_polarity . Otherwise it uses the default seed.
  • No images are used, it’s all done via CSS and/or HTML Canvas elements
  • The entire payload of this is less than 25kb! (when accounting for gzip)

Here is how it looks on a mobile device:

js-space2

Why Did you build this?!

A great question. :) Initially I wanted to make a MMO 2D Space game. I still want to do that, but after working on this early prototype, I am convinced I don't want to do it in JS. Still, I learned a lot from this and definitely upgraded my JS skills.

Do you plan on developing it any farther?

I am thinking about adding the System View, so after you click on a star, you can also view the system of planets surrounding the star, click to get their info, etc.

< Older Newer >