Skip to content

Instantly share code, notes, and snippets.

View isuvorov's full-sized avatar
🎃
Программирую и предпринимаю

Igor Suvorov isuvorov

🎃
Программирую и предпринимаю
View GitHub Profile
@isuvorov
isuvorov / __dirname.js
Created April 18, 2024 05:09
ESM __dirname and __filename
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
export const getFilename = (meta) => fileURLToPath(meta.url);
export const getDirname = (meta) => dirname(getFilename(meta));
const __filename = getFilename(import.meta);
const __dirname = getDirname(import.meta);

Онбординг фронтендера на Амплифере

Дать доступ. Менеджер и Макс даёт доступ. Фронтовый тимлид пинает их, уточняет у нового фронтендера дали ли ему все доступы, пинаем ещё раз, если надо.

  1. Выдать почту на @amplifr.com
  2. Доступ в Slack
  3. Доступ в Trello
  4. Доступ в GitHub
  5. Доступ в Zeplin
  6. Доступ в Sentry

Принципы разработки Амплифера

Тут перечислены не законы, последние слово всегда за здравым смыслом. Тут перечислены лишь направление, куда надо стремиться. Принципы, которые должны помочь, когда не знаешь, что выбрать.

Ценности

  1. Пользователь. Если что-то сильно мешает UX или есть критическая ошибка, то в первую очередь мы спасаем пользователей. Для этого иногда надо взять ответственность на себя, переубедить толпу, написать плохой код.
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@RANUX
RANUX / комбинации-клавиш-bash.txt
Last active April 12, 2024 13:24
Комбинации клавиш для Bash
##### Перемещение курсора:
Ctrl + a — переход в начало строки
Ctrl + b — переход на 1 символ назад
Ctrl + c — посылает программе SIGINT. Обычно, прерывает текущее задание
Ctrl + d — удаляет символ под курсором (аналог delete)
Ctrl + e — переход к концу строки
Ctrl + f — переход на 1 символ вперёд
Ctrl + xx — переходит от текущей позиции курса в начало строки и обратно.
Ctrl + p — Предыдущая команда (Стрелка вверх)
@missingdays
missingdays / anagram.js
Last active January 21, 2016 11:24
Such anagram
function addLetters(s){
var letters = {};
for(var i = 0; i < s.length; i++){
var letter = s[i].toLowerCase();
if(letter != " "){
if(letters[letter]){
letters[letter] += 1;
} else {
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 22, 2024 11:45
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@lexrus
lexrus / disable_all_animation.sh
Created August 1, 2014 06:05
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
@millermedeiros
millermedeiros / osx_setup.md
Last active April 12, 2024 12:40
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...