Skip to content

Instantly share code, notes, and snippets.

View kroleg's full-sized avatar
⌨️
Mechanical keyboi

Vitaliy Zaytsev kroleg

⌨️
Mechanical keyboi
  • StashAway
  • Russia, Krasnodar
View GitHub Profile
@kroleg
kroleg / .dockerignore
Last active October 30, 2018 16:00
Gitlab ci tests
node_modules
server/dist
public
.idea
.settings
.project
*.log
@kroleg
kroleg / object.pick.js
Created October 13, 2016 11:38
Returns a filtered copy of an object with only the specified keys, similar to _.pick from lodash / underscore.
'use strict';
// source: https://github.com/jonschlinkert/object.pick
function isObject(val) {
return val !== null && typeof val === 'object' && Array.isArray(val) === false;
}
module.exports = function pick(obj, keys) {
if (!isObject(obj) && typeof obj !== 'function') {
@kroleg
kroleg / format.js
Created November 24, 2014 12:40
Format money
money.toFixed().replace(/\d(?=(\d{3})+$)/g, '$& ');