Skip to content

Instantly share code, notes, and snippets.

View nckcol's full-sized avatar
💩
lets get shit done

Nikita Popov nckcol

💩
lets get shit done
View GitHub Profile
@bvaughn
bvaughn / index.md
Last active June 7, 2024 15:03
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@sandcastle
sandcastle / timezones.ts
Created January 29, 2018 00:19
A timezone list with grouping by timezone, in TypeScript.
export interface IanaTimezone {
group: string;
timezone: string;
label: string;
}
export const IANA_TIMEZONES = [
// UTC+14:00
{ group: 'UTC+14:00', timezone: 'Pacific/Kiritimati', label: 'Pacific/Kiritimati (+14)' },
// UTC+13:00
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 6, 2024 13:00
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@fstanis
fstanis / index.html
Last active March 16, 2020 03:15
Webpack HTML entry
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
@branneman
branneman / fp-lenses.js
Last active May 17, 2023 00:56
JavaScript: Lenses (Functional Programming)
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
@akella
akella / setup.md
Last active February 21, 2023 22:59
Мой сетап

То что я использую в работе и стримах

Софт для разработки

@kutyel
kutyel / webpack.config.babel.js
Created June 13, 2017 08:21
Webpack 2 with React, CSS Modules & SASS
import webpack from 'webpack';
import { resolve } from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import ForceCaseSensitivityPlugin from 'force-case-sensitivity-webpack-plugin';
import autoprefixer from 'autoprefixer';
import getClientEnvironment from './config/env';
const nodeModulesPath = resolve(__dirname, 'node_modules');
const bowerModulesPath = resolve(__dirname, 'bower_components');
const srcPath = resolve(__dirname, 'src');
@kbariotis
kbariotis / main.yaml
Last active November 27, 2023 21:02
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
tasks:
- name: LOCAL | Generate SSH key
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N ""
@nrollr
nrollr / nginx.conf
Last active June 9, 2024 23:39
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration