Author Archives: Rex

Setting up your Mac to create a Playdate app

This guide is written on macOS Monterey (v12.3).

playdate simulator

Here are instructions on setting up & running the most barebones app possible on macOS. There are probably better ways to do this, but here’s one way that works for me.

  1. Download & install the SDK via https://play.date/dev/

  2. Update your ~/.zshrc file with the following line:

    export PLAYDATE_SDK_PATH=/Users/rex/Developer/PlaydateSDK

    Obviously you want to replace “rex” with your username.

  3. Create a new folder for your project (anywhere)
    mkdir playdate_hello_world
    cd playdate_hello_world

  4. Create a VS Code folder & settings file
    mkdir .vscode
    touch .vscode/settings.json


  5. Put the following into your new settings.json file. Make sure to replace the 2 instances of “rex” with your username

    {
    "Lua.runtime.version": "Lua 5.4",
    "Lua.diagnostics.disable": [
    "undefined-global",
    "lowercase-global"
    ],
    "Lua.diagnostics.globals": [
    "playdate",
    "import"
    ],
    "Lua.runtime.nonstandardSymbol": [
    "+=",
    "-=",
    "*=",
    "/="
    ],
    "Lua.workspace.library": [
    "/Users/rex/Developer/PlaydateSDK/CoreLibs"
    ],
    "Lua.workspace.preloadFileSize": 1000,
    "playdate.sdkPath": "/Users/rex/Developer/PlaydateSDK"
    }


    (Apologies for the formatting. WordPress & code doesn’t mix well). You can copy & paste above (and make sure to replace the 2 “rex”s)

  6. Create a simple file for your app
    mkdir source
    touch source/main.lua

    Copy the following into main.lua:

    import "CoreLibs/object"
    import "CoreLibs/graphics"
    import "CoreLibs/sprites"
    import "CoreLibs/timer"

    function playdate.update()
    print "Hello world"
    end


    Obviously this code does not do very much. It’s super, super basic, but it compiles & runs!

  7. Install the following VS Code extensions (sumneko.lua, jep-a.lua-plus, and Orta.playdate)

  8. Run your app on the Playdate Simulator with VS Code.

    Press Cmd + Shift + P and select & run [Run app in Playdate simulator]

  9. That’s it! Your app is now running on the Playdate sim. You can view print statements by using Window > Console.

For more comprehensive details, refer to the SDK documentation: https://sdk.play.date/1.10.0/

For the sample files discussed here, see repo: https://github.com/xta/playdate_hello_world

Legoland 2022 1-Day Trip Review

We went for a day in March during spring break. With young kids, we had some height restrictions, but most rides were available since Legoland is for young kids. The park was busier than I expected, but overall it was much better (less crowded) than summer time.

Legoland sells VIP access to skip lines, but I wasn’t interested. Plus, we’ve already been to Legoland a handful of times so I didn’t see the need to pay extra.

I downloaded the official Legoland app, which was extremely helpful in looking at estimated ride wait times. Too bad their app doesn’t let you order food like Disneyland’s app does.

While picking rides in the park, I focused on rides with shorter wait times & rides that were nearby. If there was a ride nearby with a short line, I definitely took my kids to check it out.

Attractions List with comments

Junior Driving School / Driving School

  • This is fun for kids to drive around

Sky Patrol

  • basic helicopter ride. what you see is what you get. fun

Fun Town Police and Fire Academy

  • this was a competitive ride (competing against other groups). pumping (to move the truck) was harder than expected

Skipper School

  • this boat ride was fun, but the line was really long. the wait wasn’t worth it

Legoland Express

  • simple train ride for toddlers. it’s fun, and no wait is awesome

DUPLO Playtown

  • this was ok. kids can play in the playground. the Duplos were scarce (COVID safety precaution?)

Queen Watevra’s Carousel

  • it’s a basic carousel ride. you either like it or you don’t

LEGO Movie 2 Experience

  • this simple walkthrough is cool for Lego set piece nerds, but it might not be interesting for everyone

Coast Cruise

  • simple, boat tour. I feel bad for the tour guides since they have to repeat the same pun jokes over and over

The Royal Joust

  • this thing always has a long line? it works well for the kids to wait in line while I get food nearby…

Knights’ Smokehouse BBQ

  • the lunch options are decent. typical, pricey theme park food, but the BBQ itself is not bad. if you get here during lunch hours, be prepared to wait in a long line

Cargo Ace

  • simple, kid friendly plane ride

Bionicle Blaster

  • these saucers spin around fast. shorter/younger children can’t ride it

Ninjago the Ride

  • our family isn’t super into Ninjago. the ride was OK, but I think my sensor hand placement was off since it wasn’t working well

Eglor’s Build-a-Boat

  • it’s legoland, so there’s different lego stations for kids. this one was a decent distraction. the Legos didn’t seem to be that clean considering the amount of water they are exposed to

Fairy Tale Brook

  • this ride is awesome. the decor is standard fare. I always enjoy this simple boat ride with almost no wait

LEGO Factory Tour

  • we walked through some Lego factory machines and the kids were able to build with Legos. this was more of a time sink

LEGO City Deep Sea Adventure

  • this sub ride was ok. there was no line, and I’m not a huge fan of the treasure hunt activity (spot things in the water)

The Hideaways

  • this play ground at the top of the theme park was fun for the kids to run around. I have to assume due to COVID, all the tube slides were closed (sealed at top & bottom). No slides makes getting around the vertical playground a bit odd

The Big Shop

  • always packed at the end of the day. The shop is OK. I think most stuff you can find online at a similar or better price. I didn’t find any notable exclusive Legos this day. If you show them your Lego.com VIP, you get a small discount

Legoland is fun for young kids, but it’s easy to run out of things to do after your 1st day. Costco has a 2 day ticket promo (with 2nd visit in 14 days of 1st visit), but that’s more Legoland than we need.

Disneyland 2021 1-Day Trip Review

We went for 1 day in August with young kids, meaning we couldn’t go on all the rides (height restriction). When we went, there was no park-wide fast pass system, so I didn’t have to worry about optimizing the next fast pass.

Before going, I downloaded the official Disneyland app (with my account & tickets set up). This is important since it lets you join boarding groups (Rise of the Resistance) at 7 am (outside the park) or 12 noon (in the park). If you are trying to join a boarding group, make sure you try exactly when it turns 7a (or 12). The official app also makes ordering food easy.

Some helpful tips: 1.) Go early. Try to get there when the park opens (like 8am) or even before they open (line up for rope drop). This will let you go a number of rides early in the day when lines are shorter. 2.) With tip #1, go on rides with longer lines first. Here’s a site showing sample wait times.

Ride List with comments

  • Jungle Cruise
    • alright. The guide was good, but the scripted dad jokes were soso
  • Pirates of the Caribbean
    • decent. This is classic Disneyland
  • Haunted Mansion
    • decent. This is classic Disneyland
  • The Many Adventures of Winnie the Pooh
    • fun for young kids
  • Mad Tea Party
    • decent. your typical spinning kid ride
  • King Arthur Carousel
    • decent. your typical carousel ride
  • Star Wars: Rise Of The Resistance
    • decent. It wasn’t the best thing ever. I enjoyed the impressive set pieces. This ride broke down twice on us (used Rider Switch) and ate up much of our afternoon.
  • It’s a Small World
    • good. This is classic Disneyland
  • Autopia
    • good, but they need to make the cars electric. The gas fumes are awful
  • Buzz Lightyear Astro Blasters
    • good, but it’s hard to tell where you are aiming
  • Mickey’s Mix Magic (9pm)
    • decent. Instead of a parade, they projected a show onto the castle and lit up a ton of fireworks

Food List with comments

  • Mickey-shaped Beignets @ [Mint Julep Bar, New Orleans Square]
    • mediocre. we were hungry in the morning, but these did not knock my socks off
  • New Orleans Mint Julep @ [Mint Julep Bar, New Orleans Square]
    • tasty, non-alcoholic drink
  • hand-dipped corn dogs @ [Stage Door Café, Frontierland]
    • tasty, but I was feeling fried food overdose
  • chicken tenders kids meal @ [Stage Door Café, Frontierland]
    • alright. your typical generic theme park kids meal. including a mandarin orange was good
  • Dole Whip Soft Serve @ [Tiki Juice Bar, Adventureland]
    • good, but I prefer the float! Don’t @ me
  • Dole Whip Float @ [Tiki Juice Bar, Adventureland]
    • amazing. Dole whip floats are always great, even more so on a hot day
  • frozen cherry lemonade @ [Fantasyland cart]
    • not good. the cherry flavoring didn’t remind me of cherry
  • blue milk @ [Milk Stand, Star Wars: Galaxy’s Edge]
    • good. this may have been an acquired taste. The tropical flavor was delicious
  • green milk @ [Milk Stand, Star Wars: Galaxy’s Edge]
    • average. I tried the citrus flavor, but it didn’t remind me of citrus and didn’t hit the spot

Disneyland was a fun-filled day for our family. Since we don’t go often, I try to do as much as possible. This is tough with kids, but we had strollers and took a break in the middle of the day to let the kids rest.

Having secured the Rise of the Resistance boarding group at noon, I think we accomplished more than enough. If we had more time in the afternoon, there were plenty of rides in Fantasyland to try or Mickey’s Toontown to visit.

Video game inventory

A game’s choice of inventory system can make gameplay worry-free or stressful. In the worst cases, managing your items can feel like work or make you not want to play at all.

Inventory comes in many forms. I’m specifically referring to the player’s management of limited inventory space. This space may include crafting materials, usage items, and collectibles. Sometimes, the item management & finding upgrades becomes the game, in the cases of the Diablo or Borderlands series.

Here is an inventory (get it? sorry) of my recently completed games and their handling of inventory. As you can tell, these are all single player games. No plot spoilers. Below are inventory mechanics ratings, not overall gameplay ratings.

The Legend of Zelda: Breath of the Wild – awful

The game has inventory for different weapon types. While you don’t need to max out your inventory size, it helps so you can collect different weapons. My issue with this game is the laughable item durability. Items break often with some usage. This was an intentional gameplay mechanic, but it made me conscious enough that I would strongly consider avoiding battles just to keep my inventory pristine. Given the choice, I would prefer a game with weapons that did not disappear completely, an affordable repair cost for broken weapons, and a more limited inventory size.

Horizon Zero Dawn – below average

In the resources section, your character holds trading parts, crafting material, and other items. By fighting enemies, you’ll usually pick up parts and materials. At the end of the game, I had a few of each part and a good amount of crafting materials. Crafting materials are important to have since you craft ammo to fight with. With my inventory maxed out at the end of the base story and at the start of the expansion (The Frozen Wilds), figuring out which parts to sell is such an ordeal that it’s killed my interest in exploring the expansion. Each new fight, I get more items that remind me my inventory is at capacity. This game would really benefit from a storage chest in town to offload parts that I don’t need constantly.

Control – acceptable

This game has weapon mods, personal mods, and confusingly named materials to find. While it is easy to fill up your inventory, the ease of cleaning up my inventory made the system a non-issue. Also, the game’s sorting options for mods (rarity, type, etc) made clean up easier.

Marvel’s Spider-Man: Miles Morales – good or N/A

This game doesn’t really have inventory. Miles has ammo counts for his gadgets, but those are easy to replenish. This game is all about swinging around Manhattan and fighting lots of well-armed enemies (somehow everywhere in the city).

The Last of Us Part II – good or N/A

This game doesn’t have a complicated inventory system. You can find crafting materials or collectibles. If you max out your crafting materials space, you can’t pick up anymore until you use it up. Fair enough.

Wrapping it up, I wish more developers would consider adding Quality of Life improvements after you complete the game. This could come in the form of a massively expanded inventory (if the game’s inventory size was typically limited).

In The Last of Us Part II, New Game+ lets you purchase and use gameplay modifiers (such as cheats), which made replaying the game notably different. Fighting tough monsters without worrying about ammo? Sign me up!

Yosemite Day Use Ticketed Entry

Due to COVID-19, Yosemite National Park restricted entry by requiring a Day Use Entry reservation online. This 7 day pass required you to check-in on the 1st day. Since the day use reservation is no longer applicable (as of Nov 1st), I’m posting my experiences with the system.

I started looking into day use passes in mid October since I wanted to visit around 10/25. A large block of day passes were made available weeks ago, but it was too late for me. The remaining day passes are made available daily, 2 days in advance at 7AM. So checking at 10/23 7AM would let you get a 10/25 ticket.

As part of understanding the reservation system more, I tried to snag tickets for Saturday, 10/24, on 10/22 at 7AM. I was unable to get tickets since they sold out right away. I was stuck on a loading screen for a couple minutes, and sure enough, when I refreshed, the tickets were all gone. So I would have to wake up at 7AM the next day and try again (for a 10/25 pass).

When you make a reservation, you are able to cancel it on the recreation.gov site. I don’t fully understand the cancellation terms, but it did mean that refreshing the ticket site between 11PM and midnight (PT) seemed to have higher chances of getting a ticket due to some people cancelling their reservation at the end of the day.

Otherwise, randomly refreshing the ticket site throughout the day was an option if you are extremely desperate and have lots of free time.

The good news is that if you are able to see an available ticket on the site (and click fast!), checking out on the site was handled well. You had a 15 minute timer to purchase your ticket. The site would not prevent you from buying a ticket on different days, but you cannot have more than 1 ticket per day. Since each ticket is good for 7 days of entry, most people don’t need more than 1 ticket. Also, the ticket is tied to your name, so there is no resell or transfer.

Once you have a ticket, you must arrive on the 1st day to activate your ticket. At the entrance booth, the park person checks your day pass, your ID, and enters in the system that you showed up. You will be issued a piece of paper to stick on your window that has your license plate digits & park entry expiration date written on it. A park entry fee is also required, which is separate from the Day Use Entry this post is about.

I was worried about showing up after the entry day. The good news is on Reddit, someone claimed:

The official word is you have to be there on entry day. As far as I can tell that policy isn’t being enforced at all. I’ve entered a bunch of times on a day or two after the first day and was still let in, no questions asked.

If you want to be certain you are entered into the system on your 1st day, you need to show up during regular hours (not late afternoon or evening). When I was leaving, I saw someone arrive at the park at 5:40pm and the entry booth was unmanned. They had to get a piece of paper to self certify their arrival & entry pass # to stick on their car.

So while it took time to understand the Day Use Entry system, the system worked well. Yosemite is a beautiful national park well worth the trip.

Choices

The following involves research which may or may not be true.

The first study1 suggests we learn faster when we freely choose what to learn (as opposed to being forced). With agency, we are in control and change how we learn from our experiences.

However, this can also backfire as we can become delusional and think that we have control when we don’t. For example, following a sports superstition that does not change the game’s outcome.

The second research2 suggests that we like things because we chose them. This is backwards, since common sense dictates we choose things because we like them. This is really interesting since it suggests we rationalize our choice after the fact or ipso facto (by the fact itself).

These two phenomenons pair together and raise all kind of questions. Imagine a kid who freely chooses basketball and gets much better (than their peers who may not have chosen it). Does the kid like the sport since they are good at it or because they chose to play it in the first place? Of course, someone can have multiple reasons for why they like something, and it’s impossible to generalize since there are so many individual environmental factors to consider.

As a parent, I wonder how this can be utilized, and I don’t mean in some nefarious way. I take it to mean encouraging kids to pursue playing, reading, or learning whatever they want to. That way they will enjoy how they spend their time since they chose it.

Choice is a powerful thing, but it can also be paralyzing. With too many choices, you can waste a lot of time trying to find the best decision. The paradox of choice. Sometimes, I feel overwhelmed sometimes with prioritizing how I should be spending my free time. I don’t have an answer for this besides “do your best”, and the research suggests you will like it since you chose it. How amazing is that?


  1. Chambon, V., Théro, H., Vidal, M. et al. Information about action outcomes differentially affects learning from self-determined versus imposed choices. Nat Hum Behav 4, 1067–1079 (2020). https://doi.org/10.1038/s41562-020-0919-5
  2. Silver, A. M., Stahl, A. E., Loiotile, R., Smith-Flores, A. S., & Feigenson, L. (2020). When Not Choosing Leads to Not Liking: Choice-Induced Preference in Infancy. Psychological Science. https://doi.org/10.1177/0956797620954491

Manage Sandbox Account on iPhone (iOS 14)

While working with iOS 14 and IAPs, I was looking for the Sandbox Account management section in iOS Settings. Older guides online reference “iTunes & App Stores”, but it is somewhere else now.

From what I’ve read online, it seems like the 1st step is to attempt an IAP on your iPhone running your development build (with Xcode). You’ll be prompted to sign in, so use your App Store Connect Sandbox Tester credentials.

Afterwards, I was able to find Sandbox at the following location:
* open Settings app
* scroll down & select ‘App Store’
* scroll down & find ‘SANDBOX ACCOUNT’

Here, you can manage or sign out of your Sandbox Apple ID.

Downgrading from iOS 14 beta to iOS 13

I’ve spent several hours on this (restoring from an old computer), so here’s how I was able to restore iOS 13 (the current, non-beta iOS release). First things first, I backed up my iPhone to my computer before installing iOS 14 beta 6.

First attempt (did not work)

My iPhone backup was under iOS 13.6. Version 13.6.1 had been released, but I did not update my phone to it. I installed iOS 14 beta 6 using Apple’s profile.

Once I decided to downgrade to iOS 13, I removed the beta profile on my phone in Settings. I tried to follow Apple’s guide for removing the developer beta. The instructions for putting your device in recovery mode was confusing. I found that I had to hold the Side button for a long time.

After plugging in my phone, I think I clicked “Restore Backup”. iTunes told me that it had to download 13.6.1 first. I clicked through the notice and assumed that iTunes was going to restore my 13.6 backup and update my phone to 13.6.1. Sure, ok, iTunes do the thing.

3 hours later, my phone was restored, but it was still on the latest iOS 14 beta.

Second attempt (success)

iOS 13.7 had just come out. So I downloaded the 13.7 .ipsw file at https://developer.apple.com/download/release/#ios-restore-images-iphone-new. Also, I logged out of Find My (iPhone).

After connecting my phone to my computer, I opened iTunes and shift-clicked (PC) on “Restore iPhone…”. Warning: this wipes your iPhone. I found my downloaded .ipsw file for iOS 13.7 and let iTunes format my phone.

With my phone on 13.7, I went back to iTunes to “Restore Backup” using my 13.6 backup. 3 hours later, my phone is back on iOS 13!

New app alert (Copy Cleaner for macOS)

I’ve just released my first macOS app, a menu bar app. It’s called Copy Cleaner and it works in the background to remove tracking from URLs that are copied to your clipboard. The UX is very seamless since you use your mac normally, and common trackers (utm_source, etc) are removed automatically for you.

Working on a macOS app (on the mac App Store) was a nice diversion for me. I’m used to working in Xcode, but not on mac apps. Granted a menu bar app is different from a traditional desktop application that sits in your dock.

I built this app since it’s tackles something that I run into weekly. When I’m browsing iOS, JS, ruby, etc. newsletters, I end up clicking on many long URLs – filled with query trackers. By building this app, I don’t have to clean up my URLs manually any more. This app takes care of it.

Example

Copy this: https://www.example.com/?utm_source=newsletter&sfmc_activityid=abc12345-1234-1234-abcd-12345abcdefg&sfmc_id=123456789&utm_campaign=campaign-id-2020&utm_content=123456&utm_id=abcdefgh-1234-5678-9101-123a123abcde&utm_medium=email&utm_term=email%2campaign

You’ll paste this: https://www.example.com/

That’s it. The app works silently in the background. With Apple’s Clipboard and the app running on your mac, the URL cleaning works on both mac & iPhone.

Let me know if you have any questions. You can reach me on Twitter @rexfeng

P.S. – We’re on Product Hunt!

zsh PS1 setup

macOS Catalina uses zsh as the new default shell (instead of bash) in Terminal. This means that many people will be looking to re-setup their CLI with ~/.zshrc instead of ~/.bash_profile.

While customizing my .zshrc was a hassle, it was also an opportunity to clean up my profile and remove legacy settings.

Zsh offers an optional right side prompt, but I only used the left side prompt for now.

Here are some misc tips that I’ve found helpful:

  • For basic PS1 exports (time/date, current dir, user, etc), you can find examples here. Things like %D for the current date, %~ for the current directoy, and more.
  • In your PS1 export, you can start color formatting with %F{117} and end color formatting with %f. Replace 117 with whatever color your desire. You can find color codes here.
  • You can make your tab auto completion case insensitive (ignore case) by adding:
    zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
    autoload -Uz compinit && compinit -i
  • You can show your current git branch with:
    autoload -Uz vcs_info
    precmd() { vcs_info }
    zstyle ':vcs_info:git:*' formats '(%b)'
    setopt prompt_subst

    Note: you also need to add $vcs_info_msg_0_ in your PS1 export line.

I’ve thought about creating a zshrc WYSIWYG tool, ala Halloween Bash, but I’ve shelved those plans since there’s only so much time in a day. With macOS Catalina inevitable for macOS users, more and more people are going to be looking for easy ~/.zshrc customization.