Skip to content

Instantly share code, notes, and snippets.

nikneroz

Block or report user

Report or block nikneroz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nikneroz
nikneroz / Phoenix JWT.md
Last active Oct 13, 2019
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin
View Phoenix JWT.md

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 / redux_saga.md
Last active Oct 9, 2019
Лекция №3: Redux-Saga
View redux_saga.md
API_CALL_REQUEST описывает что мы начинаем процесс получения данных с API
API_CALL_SUCCESS описывает что store успешно получил данные и процесс получения данных завершен
API_CALL_FAILURE описывает что API вызов завершился ошибкой
@nikneroz
nikneroz / Guardian JWT.md
Last active Sep 22, 2019
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.
View Guardian JWT.md

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

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

Let's generate User model and controller.

View Cassandra DB.md

What is Cassandra DB?

Cassandra is written in Java and was open-sourced by Facebook in July 2008. This original version of Cassandra was written primarily by an ex-employee from Amazon and one from Microsoft. It was strongly influenced by Dynamo, Amazon’s pioneering distributed key/value database. Cassandra implements a Dynamo-style replication model with no single point of failure, but adds a more powerful “column family” data model.

Cassandra has become so popular because of its outstanding technical features. It isdurable, seamlessly scalable, and tuneably consistent. It performs blazingly fast writes, can store hundreds of terabytes of data, and is decentralized and symmetrical so there’sno single point of failure. It is highly available and offers a schema-free data model

Where Can I use Cassandra DB?

  • Large-scale, high-volume websites, such as Web 2.0 social applications
  • High-performance, decentr
@nikneroz
nikneroz / authorization.ex
Created Dec 11, 2017
Elixir + Phoenix Framework 1.3 + Guardian 1.0 + JWT(Refresh, Revoke, Recover) + Comeonin
View authorization.ex
# 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
```
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQtSwTZ+T3GX0NECu5U19tRr2IVbjYxRyTUfxJLDp0ZMfQbYJnO/kqMqZCvmAU9Z54amxcxI2vWjKS5yM2Zywmp29VTQsRfVqDqDp4Ay9Uyw1rC37E3NTbcG+3RLjMOTrZFnKrO6g7s3cfFyYPLZShoXQ8bwrklvdD/d0M5U8LL+eMt/FDKSTr1ccp9S9MeTb/qhYcVakXa+VZtWwDw4U7mlMSanOV9woWoKsWaNkmKjOGsJBt+6h3efhede6bvyApvKLd7ccZzuimNBGk3vqrkCfE++PZo4+qkYbEx+l8rIxn+95GD40tGYzUWBc/VB0IPLDAY448AKi585xC4yeP rozenkin@Deniss-MBP
View menu.js
import React, { Fragment, Component } from 'react'
import { NavLink } from 'react-router-dom'
import styled from 'styled-components'
import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'
import Navigation from 'components/UI/Navigation.js'
import Form from 'components/UI/Form.js'
import Burger from 'components/UI/Burger'
import background from 'assets/body-background.png'
@nikneroz
nikneroz / planning.md
Last active Jun 2, 2019
Migration Plan
View planning.md

Auth ~ 1-2 weeks

Estimations

  • Base logic ~ 1 week
  • Controllers/Views/Mailers ~ 1 week

Authentication:

Library

@nikneroz
nikneroz / puma.rb
Created May 30, 2019
Ubuntu Rails deployments(RVM, Puma, Mina, Nginx)
View puma.rb
#!/usr/bin/env puma
# start puma with:
# RAILS_ENV=production bundle exec puma -C ./config/puma.rb
# threads_count = ENV.fetch("RAILS_MAX_THREADS") { 16 }
rails_env = 'production'
app_path = '/home/deploy/my_app'
current_path = "#{app_path}/current"
@nikneroz
nikneroz / init.vim
Last active May 5, 2019
Neovim config
View init.vim
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
set clipboard=unnamed
set modifiable
" Required:
You can’t perform that action at this time.