Skip to content

Instantly share code, notes, and snippets.

View dmorenogogoleva's full-sized avatar
:electron:
=^_^=

Daria Moreno-Gogoleva dmorenogogoleva

:electron:
=^_^=
View GitHub Profile
@gaearon
gaearon / Classes.js
Created May 27, 2020 17:38
Beneath Classes: Prototypes
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();
@btoo
btoo / usePrevious.ts
Last active September 11, 2022 15:30
typescript type-safe version of usePrevious taken directly from the react docs https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
import { useRef, useEffect } from 'react';
/**
* a type-safe version of the `usePrevious` hook described here:
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
*/
export function usePrevious<T>(
value: T,
): ReturnType<typeof useRef<T>>['current'] {
const ref = useRef<T>();
@ai
ai / requirements.md
Last active December 19, 2023 14:19
Website requirements

Amplifr logo

Amplifr Landings Rules

Amplifr’s rules for landing pages created by outsource.

Requirements

@croaky
croaky / App.tsx
Last active July 25, 2021 19:55
Parcel + TypeScript + React
import * as React from 'react'
// routing, etc.
import { Reset } from '~/ui/shared/Reset'
export class App extends React.Component {
public render() {
return (
<div>
<title>Dashboard</title>
@iamakulov
iamakulov / index.md
Last active February 17, 2024 03:32
What you should (and shouldn’t) enable in Cloudflare for web performance

What you should (and shouldn’t) enable in Cloudflare for web performance

Cloudflare is a web-performance-and-security-as-a-service company.

To configure your web app to run faster, you need to:

  • sign up for Cloudflare
  • connect it to your site (by moving DNS records and setting up proxying)
  • enable a few toggles in the settings.
@pistonsky
pistonsky / HOW_TO_CODE_REVIEW.md
Last active May 11, 2018 08:22
How to code review

How to code review?

  • Review is a top-priority task. Review code soon as possible. It can help to avoid massive merge of PRs at the end of sprint and won’t waste time of team members, especially if tasks are related to each other.
  • First of all you should check if the changes are related to the task. There shouldn’t be a thing like “let me also add this stuff to this PR by the way”.
  • Initial PR comment should contain the link to corresponding trello card.
  • You should not only check the code, but also check if the modified component is working correctly in the app. You check the code very carefully, every line. When checking the component in the app, you should test all possible use cases.
  • The code should follow established code style and styled with prettier. Also, please follow English language rules and use common sense when naming variables. Do not repeat yourself, but keep it simple.
  • Code review is not for critics, it’s rather a place for common effort to make a better product. That’s why it is
@a-x-
a-x- / scroll-in-flex.md
Last active May 6, 2024 20:20
`overflow: scroll` in the `display: flex` 👿😳🤔🤯

Как поместить scroll-контейнер во flexbox и не облажаться.

overflow-flex-grid-hack

Столкнулись с проблемой: блок со скролом распепячивает flex. Давайте разбираться.

4 месяца назад показалось, что хак найден, о чём мы поспешили рассказать в твиттере, но потом стало ясно что таки поспешили.

Помотрели в спеку и mdn, но ключей к решению не нашли.

@musukvl
musukvl / medusa.html
Created August 2, 2017 19:33
medusa.io RSS feeds
<link rel="alternate" type="application/rss+xml" title="Meduza — Все" href="https://meduza.io/rss/all">
<link rel="alternate" type="application/rss+xml" title="Meduza — Новости" href="https://meduza.io/rss/news">
<link rel="alternate" type="application/rss+xml" title="Meduza — Шапито" href="https://meduza.io/rss/fun">
@mfd
mfd / graphik.md
Last active December 13, 2023 04:48
Graphik LCG font
https://cdn.rawgit.com/mfd/e7842774e037edf15919037594a79b2b/raw/665bdfc532094318449f1010323c84013d5af953/graphik.css

<link rel="stylesheet prefetch" href="https://cdn.rawgit.com/mfd/e7842774e037edf15919037594a79b2b/raw/665bdfc532094318449f1010323c84013d5af953/graphik.css">

@lqt0223
lqt0223 / knapsack.js
Created April 11, 2017 11:52
20 0-1 Knapsack problem in JavaScript
/* 0-1 knapsack problem
For an overall introduction to knapsack problem, see https://en.wikipedia.org/wiki/Knapsack_problem
Function name: knapsack
Param:
items: an array of {w: v:} (where 'w' stands for weight, and 'v' stands for value)
capacity: a positive integer number
Will return max sum value that can reach, and the chosen subset to add up to the value.