Skip to content

Instantly share code, notes, and snippets.

View nikneroz's full-sized avatar
🦄

Denis Rozenkin nikneroz

🦄
View GitHub Profile
@nikneroz
nikneroz / es6_overview.md
Last active March 13, 2018 10:15
ES6 overview

ES6

В ECMAScript поддерживаются пять примитивных типов данных:

  • Number
  • String
  • Boolean
  • Null
  • Undefined
  • Object
@nikneroz
nikneroz / tutorial.md
Last active November 16, 2019 13:15
JS, React, Webpack

JS

Webpack

@nikneroz
nikneroz / sh
Last active September 24, 2018 06:52
# /lib/systemd/system/test.service
[Unit]
Description=Phoenix server for test app
After=network.target
[Service]
User=root
Group=root
Restart=on-failure
@nikneroz
nikneroz / hound.ex
Last active January 15, 2018 16:20
Use Hound for site scrapping
config :hound, [driver: "chrome_driver"]
session = Hound.start_session()
navigate_to("https://hello.world")
:timer.sleep(7 * 1000)
json_tag = find_element(:tag, "pre")
json = inner_html(json_tag)
Hound.end_session(session)
@nikneroz
nikneroz / authorization.ex
Created December 11, 2017 09:25
Elixir + Phoenix Framework 1.3 + Guardian 1.0 + JWT(Refresh, Revoke, Recover) + Comeonin
# Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin
### User model bootstrap
Let's generate User model and controller.
```bash
mix ecto.create # create DB table
mix phx.gen.json Accounts User users email:string password_hash:string # scaffold users structure
```
@nikneroz
nikneroz / Phoenix JWT.md
Last active October 13, 2019 10:16
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string password_hash:string
@nikneroz
nikneroz / docs.md
Created September 5, 2017 13:00
Mixfit API docs

MixFit prototype API

MixFit prototype API

Version: 1.0.0

/api/v1/me/{public-address}


GET

Summary: returns BioCoin balance and reward amount

@nikneroz
nikneroz / File Upload(S3).md
Created August 2, 2017 15:04
Elixir + Phoenix Framework 1.3 + FIle upload + S3 upload

@nikneroz
nikneroz / Guardian JWT.md
Last active July 31, 2017 22:26
Elixir + Phoenix Framework 1.3 + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework 1.3 + Guardian + JWT + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string name:string phone:string password_hash:string is_admin:boolean
@nikneroz
nikneroz / Tutorial.md
Created July 20, 2017 13:56
Elixir + Phoenix Framework 1.3 + Sentinel. This is tutorial and step by step installation guide.

Phoenix Framework 1.3 + Sentinel

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf