Skip to content

Instantly share code, notes, and snippets.

View shubich's full-sized avatar

Andrei Shubich shubich

View GitHub Profile
@shubich
shubich / tslint jsx-indent.md
Last active October 27, 2020 15:09
#tslint #prettier #indent #jsxindent #tsxindent

tslint-config-prettier helps

List of tslint dev-dependencies:

  "tslint": "^5.12.1",
  "tslint-config-airbnb": "^5.11.1",
  "tslint-plugin-prettier": "^2.0.1",
  "tslint-react": "^3.6.0",
@shubich
shubich / draggable-range-slider.markdown
Created March 22, 2018 15:12
Draggable range slider
import React from 'react';
import { render } from 'react-dom';
import './style.css';
const cats = [
"http://www.pawculture.com/uploads/small-cat-breeds-card.jpg",
"http://www.pawculture.com/uploads/cats-small-places-card.jpg",
"http://facts.net/wp-content/uploads/2015/07/Cat-Facts.jpg"
]
@shubich
shubich / fibonacciAlgorithms.js
Created January 16, 2018 14:39
Fibonacci algorithms
function fiboLoop(num) {
let a = 1,
b = 0,
temp;
while (num >= 1) {
temp = a;
a += b;
b = temp;
num--;
import React, { Component } from 'react';
import { render } from 'react-dom';
import './style.css';
class App extends Component {
constructor() {
super();
this.state = {
count: 0,
};
@shubich
shubich / FizzBuzz.js
Last active January 15, 2018 11:29
Напишите программу, которая выводит на экран числа от 1 до 100. При этом вместо чисел, кратных трем, программа должна выводить слово «Fizz», а вместо чисел, кратных пяти — слово «Buzz». Если число кратно и 3, и 5, то программа должна выводить слово «FizzBuzz»
function fizzBuzz(x) {
// lcm(3, 5) = 15
if (x % 15 === 0) return "FizzBuzz"
if (x % 3 === 0) return "Fizz";
if (x % 5 === 0) return "Buzz";
return x;
}
// usage
for (let i = 1; i <= 100; i++) {