Skip to content

Instantly share code, notes, and snippets.

View scabbiaza's full-sized avatar

scabbiaza scabbiaza

View GitHub Profile
@scabbiaza
scabbiaza / List of vectors for checking on XSS
Last active December 29, 2023 07:44
ReactJS - prevent XSS vulnerability
// Theory
// http://htmlpurifier.org/live/smoketests/xssAttacks.php
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
// A full collection of HTML5 related XSS attack vectors:
// https://github.com/cure53/H5SC https://raw.githubusercontent.com/cure53/H5SC/master/vectors.txt
// Short list
<script>alert("XSS: script tag")</script>
<script src="http://hackers-site.powertofly.com"></script>
@scabbiaza
scabbiaza / typography.less
Last active July 15, 2023 15:22
Typography. Vertical Rhythm.
// How it works: https://youtu.be/IbfsvI6dh4U
@textFontSize: 20px;
@lineHeight: 1.5rem;
// Set up font size and line-height
html {
font-size: @textFontSize;
}
@scabbiaza
scabbiaza / be-challange.md
Last active October 28, 2022 16:07
BE challenge

Problem Statement

Develop an API endpoint to get a list of users.

Requirements to DB

DB should have at least 1MM records.

Requirements to API

@scabbiaza
scabbiaza / notes.md
Last active October 24, 2022 11:39
Quality Attributes for JS Frontend Application
@scabbiaza
scabbiaza / README.md
Created September 22, 2014 18:29
Flask with infinity scroll navigation

Flask with infinity scroll navigation

Using: Flask, SQLAlchemy, Infinite-scroll

@scabbiaza
scabbiaza / t1.js
Created May 27, 2019 09:18
Interview JS task
// Get list of prices of saled products that are below 1000, ordered by ASC
var sales = [
{id: 1, price: "500"},
{id: 2, price: "1500"},
{id: 3, price: "750"},
{id: 4, price: "1750"},
{id: 5, price: "150"},
{id: 3, price: "750"},
];
@scabbiaza
scabbiaza / css-questions.md
Last active February 12, 2018 10:40
CSS interview questions
  1. Difference between px, em, rem
<style>
  html, body {
    font-size: 10px;
  }
  div {
    font-size: 15px;
 }
@scabbiaza
scabbiaza / 1.md
Last active February 8, 2018 09:40
js: concepts

Data Types, mutable, immutable

What data types in JS do you know? What data types are mutable? How to solve mutability problem in the code?

var person1 = {name: 'Ana'};
var person2 = person1;
person1.name = 'Julia';
console.log(person1.name);
console.log(person2.name);
@scabbiaza
scabbiaza / macros.html
Last active December 14, 2017 08:06 — forked from maximebf/gist:3986659
form_field macros for WTForms, Flask, Bootstrap 3
{% macro form_field(form, field, print_status=True) -%}
{% set has_label = kwargs.pop('has_label', True) %}
{% set placeholder = '' %}
{% if not has_label %}
{% set placeholder = field.label.text %}
{% endif %}
{% set field_status = '' %}
{% if form.errors and (form.submitted or (form.is_submitted() and form.submit.data)) %}
{# form.submit.data for support multiple forms on page #}
{# form.submitted - manual control for form without button (ajax) #}
@scabbiaza
scabbiaza / npm.md
Last active October 26, 2017 12:30
NPM sketches

Install / Update node modules

npm install 

List of installed modules

npm list
npm list -g
npm list --depth=0