“Invalid salt revision” bcrypt-nodejs is no longer maintained and you might run into this Use bcryptjs for a more secure actively maintained experience. Also, check out Django, its great, but if you do, consider adding bcrypt
All posts by theptrk
Express Sequelize Heroku Postgres Configuration Success
You are in flow developing on your local database and you decide to upload everything to heroku and share it with the world. How do you configure your production database? It’s easier than you think. Let’s assume you have already set up your site. If you used the sequelize init command, you will have a…
Node Sequelize Postgres Tutorial
Why use Sequelize? Sometimes you want your team to use an ORM. Often you need to run migrations. Sequelize provides ORM features and a much needed migrations library that allows us to create producible and version controlled database schemas. Setup your project Step 1: Create an npm project in your desired directory $ npm init…
How does sequelize pluralize?
If you use .sync with sequlize and have a model name like User, your database ends up with a table called Users. More clearly, when you use the sequelize-cli model generator the generated file will show this pluralized table. Here is the code: (link) What is Utils? * Note Sequelize has a directory called Utils AND a file…
Postgres timestamp with timezone – “timestamptz”
Postgres can store your “timestamp with timezone” or “timestamp without timezone”.If you don’t specify either, it will default to “timestamp without timezone” Which one should you use? TLDR: “timestamps with time zones” Whats the problem living life without timezones? Say you have two users in two different timezones – one in California and one in…
Using CAShapeLayer to draw a circle
UIViews are like Ogres, which are like onions – they have layers. Source: Documentation More accurately, UIView has a single layer property that can have infinite sublayers. UIView’s have layers Lets draw a circle. First create a UIView and a CAShapeLayer: let myView = UIView() let myLayer = CAShapeLayer() Layers have a path UIBezierPath makes drawing shapes…
iOS Application Lifecycle – UIKit basics
iOS applications are all about cycles This is because the iOS applications are richly interactive when it comes to user input and much of your programming with UIKit will be delegate oriented. Knowing the many different “cycles” of the device and application will be illuminating for your development. States of the UIKit App Cycle * These are the…
iOS without storyboard
Why? Programmatically/Code or NIB based layouts are a much better fit for projects that use version control (see merge conflicts) and make it much easier to reuse views. If you are deciding not to use storyboards, you will need to manually set your application window to your desired UIWindow Prerequisites: – Delete Main Interface from Deployment…
Forgetting to set translatesAutoresizingMaskIntoConstraints to false
UIKit on iOS is great! There are tons of tools and often this can supercharge your productivity for getting a prototype out into the world. Additionally, working with AutoLayout programmatically can be great if you avoid these rookie mistakes. Rookie Mistake 1: It hurts when you spend hours dealing with the rookie mistake of forgetting to…
Delete files by filename with “find”
When you upload photos multiple times, the computer can start numbering the photos. IMG_A becomes IMG_A 1 and IMG_A 2 and IMG_A 3. Using a wildcard * and specifying the ending space and number will help you select the files. For example: Find all the files that end in “space”1.JPG find -name ‘* 1.JPG’ * Have a look at the…