Skip to content

Instantly share code, notes, and snippets.

View Beraliv's full-sized avatar
📺
Contributing to OSS 7-9am, 7-9pm UK time (respond within a week)

Alexey Berezin Beraliv

📺
Contributing to OSS 7-9am, 7-9pm UK time (respond within a week)
View GitHub Profile
@orta
orta / tsc-compiler-errors-3.svg
Last active September 6, 2021 10:25
Ideas for TSC with prettier pretty settings - click raw on this svg below
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ClickerMonkey
ClickerMonkey / types.ts
Last active February 6, 2024 07:21
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@josemarimanio
josemarimanio / install_pyenv_mac_zsh.rst
Created May 13, 2020 12:13
Installing pyenv on macOS for Zsh using Homebrew
@kaicataldo
kaicataldo / gatsby-ssr.js
Last active April 13, 2021 19:13
Dark mode using Gatsby.js
import React from 'react';
export const onRenderBody = function({ setPreBodyComponents }) {
// Load dark mode script in head to prevent FOUC.
setPreBodyComponents([
<script
type="text/javascript"
key="theme-initializer"
src="/set-dark-mode.js"
/>,

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

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

  1. Выдать почту на @amplifr.com
  2. Доступ в Slack
  3. Доступ в Trello
  4. Доступ в GitHub
  5. Доступ в Zeplin
  6. Доступ в Sentry
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@OliverJAsh
OliverJAsh / foo.ts
Last active July 29, 2023 18:16
Records and dictionaries in TypeScript
/*
In JavaScript, objects can be used to serve various purposes.
To maximise our usage of the type system, we should assign different types to our objects depending
on the desired purpose.
In this blog post I will clarify two common purposes for objects known as records and dictionaries
(aka maps), and how they can both be used with regards to the type system.