Let’s say you have a text field and you want to disable the Save button until the user enters something. But you don’t want to allow whitespaces. Here’s one way to handle that. 1. Hook up an outlet to your bar button item so you can set its isEnabled state later. 2. Hook up an… Continue reading Trim Whitespace From UITextField in Swift
Symfony New Project Setup
cd into the directory above where you want your project to live Run:
Symfony Doctrine Cheatsheet
Installing cd into your project directory and run composer require doctrine Open the .env file and set your local config. This uses root user and password password and sets the name of the database to the_spacebar
Symfony Cheatsheat
Here’s a bunch of random notes on Symfony. These are kind of a summary of the SymfonyCasts tutorial track here. Creating a New Controller Right-click on the directory where you want your controller to to (probably src/Controller) Choose “New PHP Class” Because we installed the Symfony plugin, PhpStorm can pre-fill the namespace
Find your SQLite Database for Xcode 10
To get the SQLite database for your app on all simulators on which it’s installed: find ~/Library/Developer/CoreSimulator/Devices -name MyAppName.sqlite (Xcode 10) Open Finder and do Shift + Cmd + G to bring up the “Go to folder” dialog. Paste in the file path and you should see it. It will be garbled if you try… Continue reading Find your SQLite Database for Xcode 10
Rounded Corner Button in Swift
It’s very simple to create buttons with rounded corners. Create a button like you normally would in Interface Builder, create an Outlet to it, and then in viewDidLoad, set the attributes like this: button.layer.borderWidth = 3.0 button.layer.borderColor = UIColor.white.cgColor // Set this to the background color of your button button.layer.cornerRadius = 8.0
Free Simple Hex Color Picker
TIL if you you just do a Google search for “color picker” the top result is a little widget with sliders that let you pick a color and the hex and RGB values appear below it. So easy!
Laravel New Project Steps
Here are my steps for creating a new laravel project. I know the docs are excellent but these are the steps specific to my setup, which is probably pretty common. For reference, I use the laravel installer to create new projects and I use Homestead. I already have Homestead set up so it’s just a matter… Continue reading Laravel New Project Steps
Custom key bindings in Xcode 8
I hate that Xcode doesn’t include a duplicate line shortcut. I have to keep adding it in every time a new version of Xcode comes out and every time, I have to Google it, so I’m pasting the SO post here that worked most recently. There must be a better way, but until I figure that… Continue reading Custom key bindings in Xcode 8
Docker Cheatsheet
Start a container when using Docker Compose docker-compose up -d