Floyd’s Worthwhile Endeavor v0.9.6 Released!

Posted on February 15, 2014 by David Hilowitz

A new version of Floyd has made its way to the App Store.

iOS Simulator Screen shot Feb 15, 2014, 12.52.46 PM

Level 21

  • Added a brand new game element: springboards!
  • Ten new levels featuring springboards!
  • Floyd now dies when he rides an elephant off a cliff.
  • The controller selection box now only shows up for new, new players.
  • Mid-air half jumps are no longer possible.
  • Turned external controller sensitivity down a little bit.
  • The green bamboo background is gone in favor of a darker, lettucey green artwork.
  • Lowered games file size by 10MB.
  • Added a brand new Intro Scene before the first level that explains a bit about Floyd’s mission
  • Added GameCenter integration
  • Added Achievements
  • Added a new option for controlling Floyd: Virtual gamepad!
  • Game is now fully compatible with the new SteelSeries Stratus wireless gamepad
  • Physics update: Floyd doesn’t start off running quite as fast
  • Stone blocks can no longer knock Floyd off of an elephants back.
  • Elephants now start off facing the right direction
  • Minor updates to levels 2, 3, 17, 18, and 19 to make them more fun.
  • It should now be easier to control Floyd in touch mode on an iPad
  • Touching an ostrich while jumping on a rope bridge no longer robs Floyd of the ability to jump forever.
  • Build 2022: Game has been built 261 times since last revision (7 days ago). That’s an average of 37.29 builds a day.

Enjoy!

Floyd’s Worthwhile Endeavor v0.8.4 Released!

Posted on January 27, 2014 by David Hilowitz

Floyd's Worthwhile Endeavor v0.8.4 Screenshot

A new version of Floyd’s Worthwhile Endeavor is now available on the App Store.

Here are the highlights of this release:

  • Five new types of hats!
  • Elephants are less dangerous: they can only kill you when you then are walking towards you.
  • Better memory usage
  • New help text in Level 1
  • Bug Fix: Floyd no longer falls through rope bridges
  • Build 1201: Game has been built 358 times since last revision (11 days ago). That’s an average of 32.5 builds a day.
  • Email support (at) decided.ly with bug reports or use the contact form on this site.

Get it here!

Presenting Floyd’s Worthwhile Endeavor

Posted on January 16, 2014 by David Hilowitz

For the past eight months, I have been working on an iOS game based on the photography of Eadward Muybridge. As of this week, the game is now in the App Store. Since my quiet soft-launch earlier this week, it has already been downloaded more than five thousand times!

jsTaskPaper: Display Taskpaper Todo lists as HTML using Javascript

Posted on December 23, 2013 by David Hilowitz

For the longest time I’ve wanted to set up a giant billboard-style to-do list in my office–something that would be so big that it would be hard to ignore.  I was tempted by Panic’s gorgeous Status Board iOS app, but I didn’t know how easy it would be to integrate my daily Taskpaper-based todo lists with Panic’s widgets. (Also, the thought of tying up my iPad for this project was a no go.) We have tons of old computers lying around here, all perfect for powering a read-only browser-based status board, so it seemed like a no-brainer to throw something together.

Surprisingly, there didn’t seem to be any Javascript-based TaskPaper formatters out there.  So, using Jim King’s tp_to_html.pl script as a starting point, I created jsTaskPaper, a Javascript library for rendering TaskPaper files as HTML. Here’s what the output looks like:

Screen Shot 2013-12-23 at 3.21.45 PM

Usage is pretty simple. You create a div in your HTML like so:

<div id="scratchTasks"></div>

and then you invoke the Javascript lib as follows:

<script type="text/JavaScript">
$(document).ready(function(){
new TaskPaperPanel('#scratchTasks', '<url-of-taskpaper-todo-file>', 4000);
});
</script>

That’s pretty much it. Once you’ve got it set up, you can style it using the taskpaper.css file.

Check it out here: jsTaskPaper

–Dave

Adorno Media is now Decidedly

Posted on by David Hilowitz

That is all. 🙂

TIP: How to sync your entire Sublime Text project over to your dev server with a single keystroke

Posted on September 21, 2013 by David Hilowitz

If you do all of your web coding on your laptop, but don’t run a local PHP stack, you may be searching for a quick way to sync your files over to your dev server. Well, my friends, look no further than rsync. Not only is it fast and secure, but you can actually set it up to be a build tool in Sublime Text 2. Here’s how to set that up:

1. Select the ToolsBuild System → New Build System… menu option.

Screenshot 2013-09-21 12.55.38

2. A new window will pop up with the a blank template for your new build system. Here’s what mine looks like:

{
   "cmd": ["./devsync", "${project_base_name}"], 
   "working_dir": "/Users/dhilowitz/code/"
}

As you can see, I don’t run rsync directly, but rather point Sublime Text to a shell script called devsync that lives in my ~/code directory. I have this file saved as devsync.sublime-build.

3. Finally, here’s what that ~/code/devsync script looks like:

#!/bin/bash

if test -z "$1"
then
     echo "Missing folder name argument."
else
     RSYNC_TO="user@dev.decided.ly:/mnt/www/$1/"
     echo "Syncing from `pwd`/$1 to $RSYNC_TO"
     rsync -avz --delete --exclude '.git' -e ssh ./$1/ $RSYNC_TO
fi

That’s it! Of course, your development setup is probably not identical to mine, so you will have to play around in order to get things working properly. rsync can be a finicky thing to get working if you don’t have experience with it. You may want to do some trial and error on the command line before moving your commands into the shell script. It should be noted that it is possible to actually invoke rsync directly from Sublime Text (i.e. without a shell script). It’s also possible to set it up on a per-project basis so that you use different settings depending on which project you are working with. Here’s an example of a project file that invokes rsync directly:

{
     "folders":
     [
          {
               "path": "."
          }
     ],
    "build_systems":
    [
        {
            "name": "rsync",
            "cmd": [
                 "rsync",
                 "-avz",
                 "--delete",
                 "--exclude",
                 "'.git'",
                 "-e",
                 "ssh",
                 "./site/",
                 "user@fakesite.com:/var/www/"
            ]
        }
    ]
}

Good luck!

–Dave

PHP TIP: A quick, non-RegEx way of replacing an IMG tag’s SRC= attribute

Posted on June 25, 2013 by David Hilowitz

It’s often useful to be able to swap out the src= attribute of an HTML IMG tag without losing any of the other attributes. Here’s a quick, non-regex way of doing this. It uses the PHP DOM API to create a tiny HTML document, then saves the XML for just the IMG element.

function replace_img_src($original_img_tag, $new_src_url) {
    $doc = new DOMDocument();
    $doc->loadHTML($original_img_tag);

    $tags = $doc->getElementsByTagName('img');
    if(count($tags) > 0)
    {
           $tag = $tags->item(0);
           $tag->setAttribute('src', $new_src_url);
           return $doc->saveXML($tag);
    }

    return false;
}


Note
: In versions of PHP after 5.3.6, $doc->saveXML($tag) can be changed to $doc->saveHTML($tag).

TIP: How to Play a Sound Whenever You Commit to Git

Posted on June 12, 2013 by David Hilowitz

Writing code alone at home can be an isolating experience. There you are, day in day out, quietly making magic with your mind (sarcasm, obv.) only to silently commit the fruits of your labor into the void of your source control repository, appreciated by no one. If only a crowd of children could be retained for the sole purpose of cheering you on every time you complete something.

Amazingly, Brandon Keepers over at Collective Idea had the same exact same thought (almost; he was substantially less melodramatic in his blog post about it).  Anyway, here is what my version of his script looks like:

#!/bin/sh

toplevel_path=`git rev-parse --show-toplevel`
afplay -v 0.1 $toplevel_path/.git/hooks/happykids.wav > /dev/null 2>&1 &

I put this in a file called .git/hooks/post-commit.playsound. I then trigger this from the main .git/hooks/post-commit script as follows:

#!/bin/sh

toplevel_path=`git rev-parse --show-toplevel`
$toplevel_path/.git/hooks/post-commit.tweet
$toplevel_path/.git/hooks/post-commit.playsound

Where the post-commit.tweet script is the script from this blog post. If you aren’t also tweeting your commit posts, you’ll want to delete that line.

If you want this to work for every single Git repository from now on, add these scripts to your git-core templates. You’ll have to figure out where these are (it’s different for every setup). For my Mac, they’re located here: /opt/local/share/git-core/templates/hooks/post-commit.

–David

TIP: Turn WordPress Page Titles On or Off Using Custom Fields

Posted on April 25, 2013 by David Hilowitz

Most WordPress themes display page titles for every page. This is usually what one wants, but sometimes it’s useful to be able to easily turn off WordPress page titles for individual pages but still keep them on by default. This is easy to do with custom fields. For simplicity’s sake, I am going to base these examples on the default WordPress Twenty Twelve theme although the same principle should apply to almost any theme.

The first step is to find where the page title is being generated. In the Twenty Twelve theme, this is in the content-page.php file. Go into content-page.php and find the block of code that looks like this:

<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>

and change it to this:

<?php if (get_post_meta($post->ID, 'show_title', true) != "no") {?>
<header>
<h1><?php the_title(); ?></h1>
</header>
<?}?>

As you can see we’ve wrapped the <header> tag in an “if” statement. This checks for the presence of a “show_title” custom field for this particular page. If one is present and its value also equals “no,” we don’t show the title. Otherwise, the page title is shown.

The only step left is to open up the editor for the page you want to modify. Go to the bottom of the page to the “Custom Fields” section. (If there is no “Custom Fields” section, you may have to go up to the top, click “Screen Options” and check the “Custom Fields” box.) In the “Name” box, type “show_title.” In the “Value” box, type “no.” Hit “Update.”

That’s it! Your page title should be gone from that page.

–Dave Hilowitz

How to Relay your Git Commit Messages to Twitter in 16 Easy Steps

Posted on April 2, 2013 by David Hilowitz

A while back I started using Twitter as a micro-journaling platform. I created a private Twitter account, and every few hours as I worked on code, I would jot down a private tweet to myself about what it was that I was doing. This private Twitter stream was then archived using Momento App for iPhone. After a while, it occurred to me that another stream that I would love to have archived in Momento is my Git commits as it often says more about what I’m up to than it would occur to me to write in a journal.

I set up a Git post-commit hook that posts to my private Twitter account each time I make a local commit on my development repository. Here’s what I did:

  1. Prerequisite: Create a Twitter account. It doesn’t have to be private, but it can be.
  2. Register an application with Twitter. Here’s how you do that:
    1. Go to http://dev.twitter.com. You may need to sign in again.Screen Shot 2013-04-02 at 5.12.18 PM
    2. Hover over your avatar in the top-right, and choose “My Applications” from the menu that appears.Screen Shot 2013-04-02 at 5.22.26 PM
    3. Click on the “Create New Application” Button.Screen Shot 2013-04-02 at 5.23.14 PM
    4. Fill out the next however you’d like. The website address can be anything. The name of the app can be anything. Leave Callback URL blank. Agree to the agreement, enter the CAPTCHA and you’re good to go.Screen Shot 2013-04-02 at 5.36.56 PM
    5. Next, you’ll be taken to a screen with a bunch of keys. Copy all of those down into a text editor.
    6. Click the “Settings” tab. Change to “Read and Write” for Application Type. Click Update.Screen Shot 2013-04-02 at 5.36.42 PM
    7. Go back to the Details tab. Scroll down to the bottom and click “Create my OAuth Access Token.”
    8. Wait a few seconds, refresh the page, wait some more. Eventually, at the bottom of the page a section should appear that says “Your access token.” Copy these codes down.
    9. That’s it for your Twitter App setup.
  3. Open up a shell on the machine you are planning to be commit to (and tweet from).
  4. Install http_post. You will have to compile this from source. (make and make install). Make sure it’s accessible from your PATH.
  5. Install oauth_sign. You will also have to compile this form source. (make and make install) Make sure it’s accessible from your PATH.
  6. Finally, save the following script into .git/hooks/post-commit in your Git repository.
    #!/bin/sh
    
    # PATH modification needed for http_post and oauth_sign
    export PATH=$PATH:/usr/local/bin
    
    toplevel_path=`git rev-parse --show-toplevel`
    toplevel_dir=`basename "$toplevel_path"`
    
    branch=`git rev-parse --abbrev-ref HEAD`
    subject=`git log --pretty=format:%s -n1`
    hashtags="#code #$toplevel_dir"
    tweet=$hashtags' ['$branch']: "'$subject'"'
    
    # truncate tweets that are longer than 140 characters
    if [ ${#tweet} -gt 140 ]
        then
            tweet_trunc=$(echo $tweet | cut -c1-137)
            tweet=${tweet_trunc}...
    fi
    
    consumer_key="<Put your computer key here>"
    consumer_secret="<Put your consumer secret here>"
    access_token="<Put your access token here>"
    access_secret="<Put your access token secret here>"
    url="https:api.twitter.com/1.1/statuses/update.json"
    
    http_post -h Authorization "$(oauth_sign \
    $consumer_key $consumer_secret \
    $access_token $access_secret \
    POST "$url" status="$tweet")" \
         "$url" status="$tweet"
  7. Make sure that you make the file executable. (chmod a+x .git/hooks/post-commit)
  8. That’s it! If you want to have this automatically added to any new repositories you make, modify the git-core templates. You’ll have to figure out where those are (it’s different for every set up). For me, they’re located here: /opt/local/share/git-core/templates/hooks/post-commit.

This is all based heavily on scripts at the following two links:

Good luck!

–David

 

« Newer PostsOlder Posts »