Skip to content

Instantly share code, notes, and snippets.

function doSomeThings(flag) {
if (flag)
doThat()
else
doAnother()
}
#!/bin/bash
sed -i '' 's/<old>/<new>/g' package-lock.json
sed -i '' 's/<old>/<new>/g' .npmrc
rm -rf node_modules
npm cache clear --force
npm i
@ivn-cote
ivn-cote / __tests__getStuff-test.js
Created September 13, 2017 12:47 — forked from jsdf/__tests__getStuff-test.js
Writing and testing async JS with Jest, promises and async functions
jest.dontMock('../getStuff');
describe('getStuff', () => {
let getStuff;
let request;
let stuffStore;
it('loads the data', () => {
const id = 1;
const data = {a: 1};
@ivn-cote
ivn-cote / guide.md
Last active May 15, 2017 15:15
guide to FE projects

Toy projects with React/Webpack/Redux

// bad
.block {
.block-element {}
}
.block---element2 {
.block---element2__modifier {}
}
.block-element_modifier {}
// good enough
.block {
.element {
}
.element.element_modifier {
}
}
.block.block_modifier {
}
<div class="block">
// bad
.samovar {
background-image: url('samovar.svg');
}
.teapot {
background-image: url('teapot.svg');
}
.cup {
background: white;
border-top: none;
// bad
.varenik {
background-color: white;
}
.varenik.varenik_fill_cherry {
color: red;
width: 200%;
border-radius: 20%;
}
.varenik.varenik_pirog {
// goood
.varenik {
.varenik-pastry {
background-color: white;
}
}
.varenik.varenik_fill_potato {
border-radius: 40%;
}
.varenik.varenik_fill_cherry {
// good
.button {
.button_text {
display: inline-block;
border: none;
background: transparent;
@include linkRules
}
}
a.link {