Skip to content

Instantly share code, notes, and snippets.

View scabbiaza's full-sized avatar

Tatiana Kleshnina scabbiaza

View GitHub Profile
@scabbiaza
scabbiaza / gist:ecab1f18f5c168d3e9b5
Created September 1, 2015 09:20
Bind/unbind with namespaces
// handler for click event
var h1 = $("h6").bind("click", function () {
console.log('click handler');
});
// handler for click event with namespace
var h2 = $("h6").bind("click.namespace", function () {
console.log('click handler with namespace');
});
// click event result:
@scabbiaza
scabbiaza / Semantic-UI-flexibility.md
Last active August 29, 2015 14:27
Semantic-UI flexibility

Ability to compile styles from own build system 👍

How to: https://github.com/Semantic-Org/Semantic-UI-LESS

Ability to store site styles separately from semantic and in own place 👍

Put files wherever you need, but update path to this folder in the theme.config

Fonts

Keep fonts optimized

  1. Set should be as minimum as possible

  2. Fallback on smaller fontset / standart fontset on mobile devices

  3. woff2 fonts types for progressive browser (Chrome, Opera, Android)
    Converter: https://everythingfonts.com/woff-to-woff2

@scabbiaza
scabbiaza / git
Last active August 29, 2015 14:26
# Set editor
https://help.github.com/articles/associating-text-editors-with-git/
$ git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@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 / 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 / gist:b75f4725c7c1bf7b5513
Created June 11, 2015 14:36
JS: missed module error cases
*Compilation JS with gulp-browserify*
Case # 0. Any error in NOT included files
Result: no errors by compilation and running
Case # 1. Missed lib on the disk
app.js
// http://jquense.github.io/react-widgets/docs/#/datetime-picker
//
// <form>
// [date] [time]
// </form>
//
// Both fields return datetime format:
// To compine them in one
let dateField = "Fri Jun 12 2015 15:08:31 GMT+0200";
// check that event.target is the one that we need
var isNavbarToogle = event.target.path.filter(function(item) {
return (item.classList.contains("navbar-toggle") || item.classList.contains("navbar-header"));
}).length == 2;
// to know when gulp task is end
Gulp.task("name", function () {
console.log('started >>>');
return .....
.pipe(Gulp.dest("build"))
@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