This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a throttled function that only invokes _throttledFunc_ at most once per every _timeout_ milliseconds | |
* https://youtu.be/9jtfYW6o1PE?t=4593 | |
* | |
* @param {Function} throttledFunc | |
* @param {number} timeout | |
* | |
* @returns {Function} | |
*/ | |
function throttle(throttledFunc, timeout) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- bubble sorting ---- | |
const langs = ['python', 'javascript', 'c++', 'haskel', 'php', 'ruby']; | |
langs.sort(); | |
for (let i = 0; i < langs.length - 1; i += 1) { | |
for (let j = i + 1; j < langs.length; j += 1) { | |
const item1 = langs[i]; // python | |
const item2 = langs[j]; | |
if (item2[0] < item1[0]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- quicksort ---- | |
// function quicksort(numbers) { | |
// if (numbers.length < 2) return numbers; | |
// const pivot = numbers[0]; | |
// const left = []; | |
// const right = []; | |
// for (let i = 1; i < numbers.length; i++) { | |
// numbers[i] < pivot ? left.push(numbers[i]) : right.push(numbers[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin btn { | |
padding: 12px 20px; | |
max-width: 200px; | |
min-width: 160px; | |
min-height: 40px; | |
font-family: inherit; | |
font-weight: 600; | |
font-size: 12px; | |
line-height: 1.33; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.price { | |
background-image: url(../images/price/bg-price_sm.png), | |
linear-gradient(to bottom, #191c26, #191c26); | |
background-image: -webkit-image-set(url(../images/price/bg-price_sm.webp) 1x), | |
linear-gradient(to bottom, #191c26, #191c26); | |
// Завантаження ретінізованого 2х фонового зображення | |
@include mq(retina) { | |
background-image: url(../images/price/bg-price_sm@2x.png), | |
linear-gradient(to bottom, #191c26, #191c26); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture> | |
<source | |
media="(min-width: 1280px)" | |
srcset=" | |
./images/gallery/gallery-2_lg.webp 1x, | |
./images/gallery/gallery-2_lg@2x.webp 2x | |
" | |
type="image/webp" | |
/> | |
<source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin mq($type) { | |
$mobile: 480px; | |
$tablet: 768px; | |
$desktop: 1200px; | |
@if $type == 'mobile-only' { | |
@media screen and (max-width: #{$tablet - 0.02}) { | |
@content; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"scope": ["comment"], | |
"settings": { | |
"fontStyle": "italic", | |
"foreground": "#ffff35" // change color only for the comment text | |
} | |
} | |
// { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 100, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false, | |
"arrowParens": "avoid", |
NewerOlder