Skip to content

Instantly share code, notes, and snippets.

View barbagrigia's full-sized avatar

Vlad Trukhin barbagrigia

View GitHub Profile
const input = [
'racecar',
'racecarff',
'abbccc',
'a',
'aabb',
'cabc',
];
input.forEach(word => {
@barbagrigia
barbagrigia / Build.md
Created December 8, 2018 15:16 — forked from BTMPL/Build.md
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

import React from "react";
import { render } from "react-dom";
import PropTypes from "prop-types";
class TweetForm extends React.Component {
state = {
text: ''
}
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { StyleSheet, View, Alert } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
import {
Container,
Content,
Icon,
@barbagrigia
barbagrigia / svgicon.css
Created November 29, 2018 10:18 — forked from MoOx/svgicon.css
Svg icons with React.js with webpack loader (svg: raw-loader)
.SVGIcon {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* fix webkit/blink poor rendering issues */
transform: translate3d(0,0,0);
/* it's better defined directly because of the cascade shit
width: inherit;
height: inherit;
const puppeteer = require('puppeteer');
let browser = puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
async function test(url) {
browser = await browser;
const page = await browser.newPage();
const a = Date.now();
await page.goto(url, {
#!/bin/bash
docker run --rm --name test-container -v $(pwd):/home/circleci/codesandbox-client -w /home/circleci/codesandbox-client -d -t codesandbox/node-puppeteer yarn start:test && \
sleep 6 && docker exec -it test-container yarn test:integrations && \
docker stop test-container
import * as React from "react";
import * as Vue from "vue/dist/vue";
import VueElement from "./VueElement";
import { PropertyControls, ControlType } from "framer";
// Define type of property
interface Props {
text: string;
}
const animationVars = {
speed: {
veryFast: 100,
fast: 200,
normal: 300,
slow: 400,
verySlow: 500,
},
ease: 'ease-in-out',
// For use as transition: opacity ${animationVars.hoverCss};
@barbagrigia
barbagrigia / tokens.md
Created August 7, 2018 20:12 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Preconditions:

В данной заметке рассматривается работа JWT с симметичным алгоритмом шифрования (HS256/HS384/HS512)

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с логином/паролем, сохранённым в базе данных пользователей.

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.