Skip to content

Instantly share code, notes, and snippets.

View fliptheweb's full-sized avatar
🎯
Focusing

Artur Kornakov fliptheweb

🎯
Focusing
View GitHub Profile
{
id: 1,
created_by: {
id: 2,
firstname: "Artur",
lastname: "Kornakov",
username: null
},
updated_by: {
id: 2,
const capitalizeExeptions = ['dc']
export const capitalizeCityName = string => {
if (!string) return ''
string = string.toLowerCase()
if (string.includes(' ')) {
return string
.split(' ')
.reduce((result, word) => `${result && `${result} `}${capitalizeCityName(word)}`, '')
}
if (capitalizeExeptions.includes(string)) {
const Price = (props) => {
const price = props.children.toLocaleString('en', {
style: props.showSymbol ? 'currency' : undefined,
currency: props.showSymbol ? 'USD' : undefined,
maximumFractionDigits: props.showDecimals ? 2 : 0,
});
return <span className={props.className}>{price}</span>
};
<div class="container">
<header>
<slot name="header"></slot>
</header>
<main>
<slot></slot>
</main>
<footer>
<slot name="footer"></slot>
</footer>
var vm = new Vue({
el: '#demo',
data: {
firstName: 'Foo',
lastName: 'Bar'
},
computed: {
fullName: function () {
return this.firstName + ' ' + this.lastName
}
@fliptheweb
fliptheweb / update_all_staff.sh
Created January 20, 2017 11:06
Global system update for MacOS – AppStore, brew, npm global packages, Atom
#!/bin/sh
set -e
set -x
mas upgrade &&
brew update &&
brew upgrade &&
npm-check -u -g &&
apm upgrade -c=false
@fliptheweb
fliptheweb / quicksort.js
Last active October 14, 2016 07:25
Classic Haskell quicksort to js es6 implementation with destructuring and rest/spread operator
quickSort = ([x, ...xs]) => {
if (typeof(x) === 'undefined') return [];
return [
...quickSort(xs.filter(y => y <= x)),
x,
...quickSort(xs.filter(y => y > x))
];
}
@fliptheweb
fliptheweb / get_currency.js
Last active November 13, 2020 02:04
Google Sheets Macros (Google App Script) for getting currency of number cell
CURRENCY_MAP = {
'$': 'USD',
'₽': 'RUB', // there is a missing character in editor font
'€': 'EUR',
'฿': 'THB'
}
function _formatToCurrency(formatString) {
var currencyRegexp = /\[.*(.)\]/g;
var currency = currencyRegexp.exec(formatString)[1];

Чеклист для записи презентации:

Помещение

  1. Включить свет так же, как во время презентации (у нас в переговорке включить «заднюю» стенку).
  2. Убрать из помещения все шумные предметы, скрипящие стулья, настроить кондиционер на наименьший шум.
  3. Изолировать помещение от посторонних шумов извне, закрыть окна и двери.

Камеры, запись:

  1. Проверить полную зарядку батареи на камерах.
  2. Проверить свободное место на карте памяти.
$ npm install -g node-legofy
-
> canvas@1.3.1 install /Users/fliptheweb/.nvm/versions/node/v0.12.7/lib/node_modules/node-legofy/node_modules/canvas
> node-gyp rebuild
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while trying to load binding.gyp