This file contains hidden or 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
// Product data: fetched from a database/any storage | |
const products = [ | |
{ code: "VOUCHER", name: "Voucher", price: 5 }, | |
{ code: "TSHIRT", name: "T-shirt", price: 20 }, | |
{ code: "MUG", name: "Coffee mug", price: 7.5 }, | |
]; | |
// Rules. This is where business logic lives. | |
const rules = { | |
secondFree: (total, amount) => { | |
if (amount < 2) return total; |
This file contains hidden or 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
// Product data: fetched from a database/any storage | |
const products = [ | |
{ code: "VOUCHER", name: "Voucher", price: 5 }, | |
{ code: "TSHIRT", name: "T-shirt", price: 20 }, | |
{ code: "MUG", name: "Coffee mug", price: 7.5 }, | |
]; | |
// Rules. This is where business logic lives. | |
const rules = { | |
secondFree: (total, amount) => { | |
if (amount < 2) return total; |
This file contains hidden or 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
{ | |
"ABAP": "#E8274B", | |
"ActionScript": "#882B0F", | |
"Ada": "#02f88c", | |
"Agda": "#315665", | |
"AGS Script": "#B9D9FF", | |
"Alloy": "#64C800", | |
"AMPL": "#E6EFBB", | |
"ANTLR": "#9DC3FF", | |
"API Blueprint": "#2ACCA8", |
This file contains hidden or 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
{ | |
// -- Visual IDE changes | |
"window.zoomLevel": 1, | |
"workbench.colorTheme": "One Dark Pro", // ext: zhuangtongfa.material-theme | |
"workbench.iconTheme": "material-icon-theme", // ext: PKief.material-icon-theme | |
"editor.tabSize": 2, | |
// - font | |
"editor.fontFamily": "Fira Code", // https://github.com/tonsky/FiraCode | |
"editor.fontLigatures": true, | |
// - bracket colors (Bracket Pair Colorizer native plugin) |
This file contains hidden or 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
// For a detailed explanation regarding each configuration property, visit: | |
// https://jestjs.io/docs/en/configuration.html | |
module.exports = { | |
// All imported modules in your tests should be mocked automatically | |
// automock: false, | |
// Stop running tests after `n` failures | |
// bail: 0, |
This file contains hidden or 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
$ git ls-files --exclude-standard -- ':!:**/*.[pjs][npv]g' ':!:**/*.eslintrc' ':!:package-lock.json' | xargs wc -l | |
// Excludes png, jpg, svg and package.json files. | |
// For excluding other configuration files (eslint for example): ':!:**/*.eslintrc' |
This file contains hidden or 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
git log --pretty=oneline --no-merges --since 2019/01/01 --until 2021/12/31 | cut -d " " -f 2 |\ | |
cut -d "(" -f 1 | cut -d ":" -f 1 | sort -r | uniq -c | sort -nr -k1 |
This file contains hidden or 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
// our cache | |
let cache = { | |
val: null, | |
res: null | |
} | |
const myLongTask = num => { | |
// if parameter is equal to our cached value, we don't repeat the calculation | |
if (num === cache.val) { | |
const t1 = new Date().valueOf() |
This file contains hidden or 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
sudo apt-get remove account-plugin-facebook account-plugin-flickr account-plugin-jabber account-plugin-salut account-plugin-twitter account-plugin-windows-live account-plugin-yahoo aisleriot brltty duplicity empathy empathy-common example-content gnome-accessibility-themes gnome-contacts gnome-mahjongg gnome-mines gnome-orca gnome-screensaver gnome-sudoku gnome-video-effects gnomine landscape-common libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-galaxy libreoffice-style-human libreoffice-writer libsane libsane-common mcp-account-manager-uoa python3-uno rhythmbox rhythmbox-plugins rhythmbox-plugin-zeitgeist sane-utils shotwell shotwell-common telepathy-gabble telepathy-haze telepathy-idle telepathy-indicator telepathy-logger telepathy-mission-control-5 telepathy-salut totem totem-common totem-plugin |