at

at

Just another code monkey

Palm Coast
87 posts
WebsiteTwitterFacebook
Obj-C

Objective-C: Format Currency Strings from Double Values with NSNumberFormatter

Converting a decimal number to a currency string is simple with NSNumberFormatter.

  • objc
Xcode

Compiling Facebook SDK with Xcode 6

Compiling Facebook SDK with Xcode 6 is not yet an option.

Git

Checkout a file (just one file) from a specific commit (revision)

git checkout 6c1d1862 AppConsumer/Curbsidr.xcodeproj/project.pbxproj

Git

Adding a tag

git tag -a prod-0.9.7 -m 'add analytics'

iOS

iOS 8 Push Notifications: Fix registerForRemoteNotificationTypes Deprecation

Push notifications on iOS 8.

iOS

Support Native iPhone 6 and 6 Plus Resolutions with Launch XIBs in iOS 8

By default all the apps (even compiled with Xcode 6 and iOS 8) will run in a scaled mode on both iPhone 6 & iPhone 6 plus.

osx

Updating Homebrew after OS upgrade

Unfortunatrly, Homebrew breaks after an upgrade to OS X Yosemite.

Ghost

Upgrading Ghost to the latest version

Keeping Ghost installation up-to-date is important not only because of new features added but also because of all the security updates.

osx

Thunderbolt Display firmware Update 1.2

The update just failed every time I tried to install.

Python

Send Apple Push Notifications with Python 2.7

Yosemite has Python 2.7.6 built in but for many reasons (one of them is sudo) we prefer a clean up-to-date install.

iOS

Xcode: Set iOS App Display Name per Build Configuration

Having a different application name for release and development builds.

iOS

Fix fileExistsAtPath Always Returning NO in iOS 8 Cache Directories

Generating the path dynamically with NSSearchPathForDirectoriesInDomains.

iOS

NSURL URLWithString vs fileURLWithPath: Loading Local Files Correctly in iOS

A frequent mistake when playing a local video using [AVAudioPlayer initWithContentsOfURL:url] is to use URLWithString instead of fileURLWithPath.

Rails

Installing Nginx with Phusion Passenger, RVM, and Ruby on Rails on Ubuntu

Digital Ocean has a great tutorial on how to install Nginx with Phusion Passenger, RVM, and RoR on Ubuntu.

Ubuntu

mysql2 gem error after upgrading MySQL database

After upgrading to MySQL 5.6 from 5.5 we started getting an error: Incorrect MySQL client library version!

itunes

Cutting off songs early

We all understand the frustration users experience when software malfunctions...

Android

Adding an external library

We needed to add Volley networking library into our project.

Ubuntu

pip IncompleteRead error after Ubuntu upgrade

After upgrading ubuntu pip started throwing the following error...

Nginx

Renewing GoDaddy SSL certificate

Renewing a certificate is not fun so it is better to use Let's Encrypt but if that is not an option...

Nginx

Location block and rewriting URLs

URI - the part of URL that comes after the domain (or IP/Port) name.

Swift

Swift Cheat Sheet: Common Syntax, Patterns, and Shortcuts

Just a bunch of short expressions in Swift.

Xcode

iOS Auto Layout in Xcode: Position Views Relative to Each Other

Positioning views relative to one another with auto-layout was fairly tricky until...

iOS

Stack Views on iOS 8 with Auto Layout (Without UIStackView)

While starting iOS 9 we have UIStackView, it is a little bit tricky to stack views vertically or horizontally.

Swift

Using guard in Swift to Test for Empty Strings Safely

In Swift, we have a syntax candy called 'guard'..

Xcode

Debug Auto Layout Constraints with Xcode 7’s Debug View Hierarchy

A small button named 'Debug view hierarchy', displays current view hierarchy in 3D.

Swift

VIPER Architecture in Swift: How to Decouple iOS Modules

Decouple, separate, disengage, or dissociate (something) from something else.

mongodb

Importing a Shapefile into MongoDB using GeoJSON

Shapefiles are technology from the past when desktops ruled supreme.

Git

Update Git to respect a newly added .gitignore

git rm -r --cached .

Swift

Fix β€œwas deallocated while key value observers were still registered” Crashes in Swift

Debugging errors that are a result of observers being added to an object and not removed from it can be hard.

Swift

Swift Error Handling: Catching Throwing Functions with a Helper Wrapper

Recently we had a need in a general way to catch calls that can throw an exception.

Xcode

Xcode 8 Core Data: Create NSManagedObject Subclasses in a Swift Project

In Xcode 8, it is no longer possible to create NSManagedObject subclasses...

Swift

Swift 3 Compiler Segmentation Fault 11: Generics and Nested Functions Workaround

The following code is causing a compiler crash when compiled with Swift 3 and Xcode 8...

Swift

Optimize UICollectionView and UITableView Updates with Batch Inserts in Swift

Collection view is highly optimized and works great out of the box.

ReactiveSwift

ReactiveSwift: The Key Difference Between Signal and SignalProducer

A property in ReactiveSwift allows us to track its changes over time.

Swift

ReactiveSwift Playground Setup: Fix β€œNo Such Module β€˜Result’” in Xcode

According to the documentation, to use ReactiveSwift.playground the following steps must be performed...

Swift

ReactiveSwift flatten Operator: latest, concat, and merge Explained

The power of ReactiveSwift lies within its operators!

MySQL

Memory issues running Ghost with MySQL on tiny machines.

Unfortunately stabilizing MySQL on our tiny server was not simple and in fact the only thing that helped was a SWAP file.

Xcode

Fix UICollectionView β€œTerminating with Uncaught NSException” Crashes

ne of our views that contains a UICollectionView started crashing once in a while...

Node.js

Nodemailer 'Please log in via your web browser and then try again' error when using Gmail

While browsing our Node.js site logs we have noticed the following error...

Swift

Fix Unwanted Top Padding in UICollectionView on iOS 10

On iOS 10, a collection view embedded in a view has unexpected padding at the top.

Git

Keeping git history clean

git rebase -i 95eeee3^

Git

Cannot lock ref ...

git remote prune origin

Android

How to choose minSdkVersion, targetSdkVersion, and compileSdkVersion

Picking your compilesdkversion, minsdkversion, targetsdkversion.

openssl

Sign and verify data

RSA verification process is similar to RSA encryption/decryption process with one major difference.

RxSwift

RxSwift.Resources: Fix β€œUse of Unresolved Identifier 'Resources'”

RxSwift.Resources are being used to detect memory leaks during pre release tests. Solving Use of unresolved identifier 'Resources' error.

Swift

UICollectionView Self-Sizing Cells: Dynamic UILabel Layout on iOS 10

All we needed was a simple UICollectionView with just one cell that contained a label ...

iOS

Fix Auto Layout "Unable to Satisfy Constraints" for Fixed-Height Views in Cells

We needed a collection view cell that contained an image view and a label.

RxSwift

RxSwift: How to Avoid Memory Leaks with DisposeBag and Resource Tracking

RxSwift is a powerful framework and, as always, with power comes responsibility.

iOS

Symbolication in iOS Apps: Use dSYM and DWARF to Decode Crash Logs

Symbolification is the process of mapping machine addresses into the source code. The tricky part is that by default .DSYM file is only generated for release builds.

Swift

Create a Swift Framework That Uses C Code in Xcode

How to create a framework that uses C with Xcode

Swift

UIScrollView with Auto Layout in Code: Step-by-Step Guide for iOS 12+

It is fairly easy to use UIScrollView with the AutoLayout on iOS 12+ but only if one follows the following steps ...

Ghost

Ghost: why this blog no longer runs on it

We started using Ghost when it was still in its very early stages ...

Swift

When to Use [weak self] in Swift Closures (and When You Don’t Need It)

It has become pretty common among Swift experts to always use [weak self] inside of a closure to avoid retain cycles ...

Swift

XCTestCase wait Helper: Wait for Conditions Without Manual Expectations

XCTest expectations are great but it is not easy to use them.

Swift

Dependency Injection in Swift: Why and How to Inject Dependencies

Why do we need to inject dependencies and some tools that help with it...

Android

Do not trust all certificates

Trusting all certificates allows anybody to do a man in the middle attack

OpenWrt

Windscribe VPN on OpenWRT Linksys MR8300

In this article we will be setting up an OpenVPN client on OpenWrt.

Kubernetes

Deploying microservices into a Kubernetes cloud

In this article we will go over deploying microservices into a Kubernetes cloud. Part 1.

React Native

React Native Learning Path

In this article we will create a comprehensive learning path to take you from beginner to proficient in about 8-10 months with consistent daily practice.

SwiftUI

Learn SwiftUI by Building a Recipe Book App for iOS & macOS

A step-by-step guide to building a modern SwiftUI Recipe Book app for iOS and macOS.

SwiftUI

SwiftUI Alerts: Fixing Bugs When Multiple Alerts Collide

SwiftUI silently ignored save error alerts once a second alert existed, and this post captures what we learned in the Advanced SwiftUI: Lessons From Mistakes series.

SwiftUI

SwiftUI @Published Crash: β€œPointer Being Freed Was Not Allocated” Explained

During test teardown we hit a repeatable 'pointer being freed was not allocated' crash while deallocating a @MainActor ObservableObject, and this post explains why we treated it as a Swift runtime edge case instead of rewriting our architecture.

SwiftUI

SwiftUI @MainActor Initializers: Safe Default Parameters and Actor Isolation

After enabling stricter Swift concurrency checks, we started seeing main-actor isolation errors from @MainActor initializers that used default parameter values. This post explains why default parameter expressions are nonisolated and how to fix the pattern by moving defaults into the initializer body.

SwiftUI

DependencyContainer Malloc Crash in Tests – Post-Mortem

Under XCTest teardown we hit a repeatable 'pointer being freed was not allocated' malloc crash when deallocating async/Combine-heavy DependencyContainer and view models. This post explains what was happening and why we fixed it by deliberately leaking those objects in DEBUG tests only.

Learning

What typings.d.ts Is For in TypeScript Projects

A practical guide to project-level TypeScript declaration files like typings.d.ts, with examples for assets, globals, and third-party libraries.

investing

How a Dividend Stock Screener Chooses the "Top 10" (In Plain English)

A practical filter-first, then rank system: screen out unhealthy dividend stocks, score the survivors, and keep the 10 best.

Linux

How to Launch a New Amazon EC2 Instance with Amazon Linux 2023 and Add Extra Storage

Use the AWS CLI to pick the latest Amazon Linux 2023 AMI, launch an EC2 instance with a 100 GB gp3 root volume, and connect over SSH.

Nginx

Setting up Nginx with Cloudflare SSL on Amazon Linux 2023 (via Certbot)

End-to-end setup: Nginx on Amazon Linux 2023, Cloudflare DNS/proxying, and Let's Encrypt certificates via Certbot for Cloudflare Full (Strict).

nextjs

Running the Web App Locally vs. in Docker Compose

A beginner-friendly guide to using different API URLs for local development and Docker Compose, with clear environment file examples.

testing

Why Block Network Access in Tests

Block real HTTP calls in tests to keep them deterministic, fast, and safe by forcing every outbound request to be mocked.

DevOps

Docker Compose Health Checks: A Practical Guide for Junior Devs & Ops

Keeping containers running isn't enough; you need to know they're actually healthy. Learn how to configure, observe, and act on Docker health checks with practical snippets you can lift into your own projects.

investing

Quality & Profitability: A Plain-English Guide to the Core Metrics

A plain-English guide to quality and profitability metrics: what they mean, how they fit together, and how to read them without needing a finance background.

Nginx

How our site briefly redirected to a malicious page β€” and how we fixed it

Traffic to firgun.win briefly 302'd to a malicious Arweave link because a stray container had claimed port 3000. We rebuilt the app, pruned stale containers, and tightened post-deploy port checks.

investing

Valuation & Shareholder Yield: A Beginner’s Scorecard

How to read valuation and shareholder yield with a simple point system that leans on sector medians, guards against one-offs, and keeps cash reality in focus.

Architecture

Pre-generation Strategy: How We Cut Report Load Times from 3 Minutes to 20ms

How we transformed 3-minute financial report load times into 20ms responses using pre-generation, database caching, and scheduled jobs.

prisma

Upgrading to Prisma 7.5.0: A Complete Docker and WASM Troubleshooting Guide

What started as a simple Prisma upgrade became a deep dive into Docker architecture, WebAssembly file handling, and TypeScript path resolution. Here's our complete journey from 7.2.0 to 7.5.0.

Subscribe to The infinite monkey theorem

We fling fresh postsβ€”no banana peels attachedβ€”straight to your inbox.