Monthly Archives: November 2015

Don’t look back!

I broke my own rule today — if you remember a movie or game from the past in a fond way, no matter what you do, don’t watch it or play it today!  It can never live up to your memories.

Was discussing an old Spectrum game from the good ol’days this morning – Trans Am by Ultimate play the game (before they became Rare).  Remember how much I enjoyed playing it, and remembered that the car movement was super cool.  But I couldn’t leave it there — I had to do a damn youtube search…

If you remember this game fondly, DO NOT WATCH THIS VIDEO:

If you don’t remember the game, or weren’t old enough or British enough to own a Spectrum back in 1983, then don’t watch it either… basically, don’t watch it…

Google Apps…

It used to be that Google Apps was a friendly service.  It did a lot of nice things, and best of all, if you had 10 or less users it was free.  Well, things change, and Google took away the free option, and whats more annoying is they messed with the old group system.

Previously, if you needed a catchall email account like support@mydomain.com or info@mydomain.com, you just created a group for that email address and added some of your real domain users to those groups.  That part still works.

Now, however, if you reply to an email sent to support@, the reply can come from support@, but the name attached to the email is your email name & not the group name.  While not a big deal, it would be better if a response to the support query came from “support<support@mydomain.com>” and not “my name<support@mydomain.com>”.

If I’ve got to pay for a service, then I want it to work the way I want it to work… time to check out Office365 and see if that’s any better…

Turns out Google made some changes and you can now change the name associated with a group address – much better.  The Office365 option is horrible and super convoluted – but then it’s Microsoft, so I’d expect nothing less 😀

Git & Squash

I use Bitbucket & SourceTree as my preferred git solution.  I like the GUI for Sourcetree and Bitbucket lets me store multiple projects on their servers.  One thing I’ve run into is my git repositories getting too big.  This can happen for several reasons – the main one is I forget to copy my default .gitignore to a new project before initializing the repository, and then my Library folder along with lots of other useless files get included.

I’m also going to try and have less commits pushed to the server.  To that effect I’m using the interactive rebase option of Sourcetree.  This will let me make various commits during the day, and then before pushing to the server when I’m done, I’ll squash those commits into one.  That way I’ll merge all the changes and hopefully use less space.

I’m also looking into methods of removing files from the repository that I’ve accidentally added or that I later realize I don’t need and want to remove these files from all history, thus reducing the size of the repository.  I’ve been experimenting with “git filter-branch –tree-filter ‘rm <filename>’ HEAD” and “git filter-branch –index-filter ‘git rm –cached –ignore-unmatch <filename>’ HEAD” and seeing some success, but more experimentation is in order.

Useful transform property

I was messing around with an idea for a mobile game with Unity, and need to move a character in the direction it was facing.  I’ve done this before by generating a unit vector from the Y angle (it’s a top down view) using sine/cosine.  However, during a hunt for something unrelated, I found:

        playerTransform.localPosition += playerTransform.forward * velocity * Time.deltaTime;

Where, velocity is the speed the player is moving.  Turns out the transform.forward property returns the vector based on the direction of the transform, no more messy code 😀

 

Removing all children from a Transform

I updated my remove all children code to make it less error-prone.  I was having an issue with the children being deleted before the for loop completed, which left some behind.  Using LINQ I was able to adjust it to make a copy of the list of children before I called destroy:

    public static void DestroyAllChildren(Transform parent)
    {
        if (parent!=null)
        {
            List<Transforml = parent.Cast<Transform>().ToList();
            foreach (Transform c in l)
            {
                if (c!=null && c.gameObject!=null)
                {
                    if (c.childCount>0)
                        DestroyAllChildren(c);
                    Destroy(c.gameObject);
                }
            }
            parent.DetachChildren();
        }
    }

Calling parent.DetachChildren() removes the children from the parent immediately.