If you are reading this, you probably tried to write code like this
test "testing session" do
build_conn()
|> put_session(:user_id, 234)
|> get("/")
...
end
And got this exception:
def create_batch(conn, %{"people" => people_params}) do | |
changesets = Enum.map(people_params, fn class -> | |
Person.changeset(%Person{}, person) | |
end) | |
result = changesets | |
|> Enum.with_index() | |
|> Enum.reduce(Ecto.Multi.new(), fn ({changeset, index}, multi) -> | |
Ecto.Multi.insert(multi, Integer.to_string(index), changeset) | |
end) |
tap "caskroom/cask" | |
cask "google-chrome" | |
cask "firefox" | |
brew "chromedriver" | |
brew "geckodriver" |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const path = require("path"); | |
const glob = require("glob-all"); | |
const PurgecssPlugin = require("purgecss-webpack-plugin"); | |
/** | |
* Custom PurgeCSS Extractor | |
* https://github.com/FullHuman/purgecss | |
* https://github.com/FullHuman/purgecss-webpack-plugin | |
*/ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
height: 100%; | |
margin: 0; | |
width: 100%; | |
overflow: hidden; | |
} |
If you are reading this, you probably tried to write code like this
test "testing session" do
build_conn()
|> put_session(:user_id, 234)
|> get("/")
...
end
And got this exception:
module Editable exposing (..) | |
type Editable ofType | |
= NotEditing { value : ofType } | |
| Editing { originalValue : ofType, buffer : ofType } | |
value : Editable ofType -> ofType | |
value editable = |
// 1. Add Bootstrap as a dependency in package.json | |
{ | |
... | |
"dependencies": { | |
... | |
"bootstrap": "~3.3.6" | |
} | |
} |
I hate to say it but our view controllers have gotten fat, and it's our fault! We feed them protocol after protocol, business rule after business rule. They don't know any better and they just gobble them all up...
This will be a 3 part "Tune up your table view" series in which we will take an old fat view controller, slim it down with some refactoring, freshen it up with some MVVM and then make it fly with some better asynchronous operation management!
In part 1 using refactoring and a couple of Interface Builder tricks hopefully I can provide some motivation to start your journey towards getting your view controllers back in fighting shape!
UITableViews are pretty integral to most iOS apps so I'm going to use it as an example of how to change a 'fat' view controller into a 'slim' one.
Welcome back for the conclusion of this 3 part series! In part 1 we learnt how to slim down our view controllers to a manageable size. In part 2 we learnt how to strip out all the non-ui related logic. This time we are going to focus solely on the UITableView
and how we can properly handle multiple asynchronous operations in its cells for maximum performance!
As always we will be starting with our project from last time.
Our current implementation is very bad... our UITableViewCell
s are performing an expensive operation, and on the main thread no less!
The following code is currently in the setup
method of our cell: