Skip to content

Instantly share code, notes, and snippets.

View yerassylad's full-sized avatar
😃
smile, smile, smile eveyday

Ерасыл yerassylad

😃
smile, smile, smile eveyday
  • Almaty
View GitHub Profile
def isLeap(year)
if year % 4 == 0
return true if year % 400 == 0
return false if year % 100 == 0
return true
end
false
end
amount_of_days += 1 if year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
function({settings}) {}
// эквиваленты
function(state) {
const settings = state.settings;
}
@yerassylad
yerassylad / styling.js
Created December 20, 2018 20:56
material-ui styling tabs with styled-components
import React, { Component } from 'react';
import styled from 'styled-components';
import { Tabs, Tab } from '@material-ui/core';
const StyledTabs = styled(props => {
return <Tabs {...props} classes={{indicator: 'indicator'}}></Tabs>
})`
&& {
border-bottom: 1px solid yellow;
}
// component
const Component = () => {
return <div>props.value<div>
}
// container
class Container extends Component {
state = {value}
componentDidMount() {
const factorial = require("./factorial");
const c = (n, m) => {
return factorial(n) / (factorial(m) * factorial((n -m)));
}
// ________
const factorial = num => {
if (num < 0)
return -1;