joe codes

x-cart guru & custom programmer

  • About
  • Archives
  • Contact

Powered by Genesis

Archives for September 2018

Smarty preg_match

September 24, 2018 by joecodes Leave a Comment

This was not obvious to me nor apparently anyone else trying to use preg_match in Smarty so I thought I’d share the solution. Given $href=’home.php?cat=1′ and trying to get 1 out of it:

{if "/cat=(\d+)/"|preg_match:$href:$match}
  {$href = "My-Page-`$match.1`.html"}
{/if}

[Read more…]

Filed Under: Programming Tagged With: Smarty

iPhone Plus Experiment

September 21, 2018 by joecodes Leave a Comment

When the iPhone 6 Plus introduced the massive new screen option four years ago, it came with compelling Plus-only landscape features that were heavily promoted. This seemed like a great new option that should only get better as its features would surely be enhanced over time. With the iPhone XS Max debut, the experiment is over.

[Read more…]

Filed Under: Personal Tagged With: Apple

Quick Thoughts

  • I was surprised to learn that foreach in JavaScript does not have a traditional break. The loop will run to completion.

  • Who knew that combination sums across all permutation lengths of an array would be so difficult? It was a challenge but the final product looks good and takes a lot of resources. Limiting the max length for basic memory limits. Would only do something like this for occasional reporting.

  • Working on a new project that can have hundreds of forms on a page. The browser was spending way too much time in Parse HTML. Wasted a bunch of time before learning this is a long-standing bug in Chrome when there are many forms or inputs. Other browsers are fine.

Recent Posts

  • Progressive Enhancement
  • Keychain Password Search
  • Smarty preg_match
  • iPhone Plus Experiment
  • Time Machine Speed-Up Tip

Tag Cloud

Apple JavaScript Mason Perl PHP security simple Smarty speed stability Tax WWDC X-Cart

Search

Subscribe

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Recent Comments

  • Bad App Alert on Startup Item Help
  • iPhone Pre-Order Needs to Change on iPhone Pre-Order Warning
  • Apple vs Pro on My Personal Three S’s of Development