This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EctoSlugs.Repo.Migrations.CreateEctoSlugs.Blog.Article do | |
use Ecto.Migration | |
def change do | |
alter table(:blog_articles) do | |
add :slug, :string | |
end | |
create unique_index(:blog_articles, [:slug]) # should be unique | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EctoSlugs.Blog.Article.TitleSlug do | |
use EctoAutoslugField.Slug, from: :title, to: :slug | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EctoSlugs.Blog.Article.TitleSlug do | |
use EctoAutoslugField.Slug, to: :slug | |
import Ecto.Changeset | |
def get_sources(changeset, _opts) do | |
# This function is used to get sources to build slug from: | |
base_fields = [:title] | |
if get_change(changeset, :breaking, false) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EctoSlugs.Blog.Article.TitleSlug do | |
use EctoAutoslugField.Slug, from: :title, to: :slug | |
def build_slug(sources, _changeset) do | |
sources | |
|> super() | |
|> String.replace("-", "+") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[source]] | |
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
mimesis = "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(pipenv-tests) ~/Desktop/pipenv master ✗ | |
» pipenv run pytest -n 8 tests | |
Loading .env environment variables… | |
============================= test session starts ============================== | |
platform darwin -- Python 3.6.4, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 | |
rootdir: /Users/sobolev/Desktop/pipenv, inifile: | |
plugins: xdist-1.22.0, forked-0.2 | |
gw0 [111] / gw1 [111] / gw2 [111] / gw3 [111] / gw4 ok / gw5 ok / gw6 ok / gw7 ogw0 [111] / gw1 [111] / gw2 [111] / gw3 [111] / gw4 [111] / gw5 ok / gw6 ok / gwgw0 [111] / gw1 [111] / gw2 [111] / gw3 [111] / gw4 [111] / gw5 [111] / gw6 ok /gw0 [111] / gw1 [111] / gw2 [111] / gw3 [111] / gw4 [111] / gw5 [111] / gw6 ok /gw0 [111] / gw1 [111] / gw2 [111] / gw3 [111] / gw4 [111] / gw5 [111] / gw6 [111] / gw7 [111] | |
scheduling tests via LoadScheduling | |
FFFFFF..s........s..s......F..................F......................... [ 64%] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Running: `bash create_merge_conflict.sh` | |
set -e | |
PROJECT_NAME="pipenv-merge-conflicts" | |
# Creating project structure: | |
rm -rf "$PROJECT_NAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json | |
import toml | |
def read_pipenv_lock(): | |
with open('Pipfile.lock') as lock: | |
return json.loads(lock.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A002: "dict" is used as an argument and thus shadows a python builtin, consider renaming the argument | |
1 manimlib/utils/config_ops.py | |
Total: 1 | |
B001: Do not use bare `except:`, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer `except Exception:`. If you're sure what you're doing, be explicit and write `except BaseException:`. | |
1 manimlib/mobject/svg/drawings.py | |
4 manimlib/mobject/svg/svg_mobject.py | |
1 manimlib/utils/color.py | |
1 manimlib/utils/sounds.py | |
Total: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"node": true, | |
"browser": true, | |
"es6": true | |
}, | |
"globals": { | |
"document": false, | |
"navigator": false, | |
"window": false |