Skip to content

Instantly share code, notes, and snippets.

View merksam's full-sized avatar
🏠
Working from home

Evgeniy Viniychuk merksam

🏠
Working from home
View GitHub Profile
@merksam
merksam / Icon.css
Created February 14, 2021 13:39
Article / SVG Icons React / Icon.css
.icon {
display: inline-block;
vertical-align: middle;
}
.icon svg {
display: block
}
.icon:not(.icon-raw) svg path, polygon, rect, circle {
@merksam
merksam / Icon.tsx
Created February 14, 2021 13:36
Article / SVG Icons React / Icon.tsx
import cn from 'classnames';
import * as React from 'react';
import './Icon.sass';
type Props = {
name: string,
}
export const Icon = (props: Props) => {
const { name } = this.props;
const icon = require(`./${name}.svg`);
return (
@merksam
merksam / Disk Utility for NodeJS
Last active March 21, 2020 13:10
Provides interface to `df -lP` and parses its result
import { exec } from 'child_process';
class DiskService {
getAvailableSpace = () => {
/*
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/root 3745600 2808444 752184 79% /
devtmpfs 470116 0 470116 0% /dev
tmpfs 474724 0 474724 0% /dev/shm
tmpfs 474724 12228 462496 3% /run
@merksam
merksam / Timezones
Last active March 23, 2020 06:02
Short list of all timezones
[
{
"value": "Etc/GMT+12",
"offset": -720,
"label": "(GMT-12:00) International Date Line West"
},
{
"value": "Pacific/Midway",
"offset": -660,
"label": "(GMT-11:00) Midway Island, Samoa"