Skip to content

Instantly share code, notes, and snippets.

View olegchursin's full-sized avatar
🐬
Common sense isn't very common.

Oleg Chursin olegchursin

🐬
Common sense isn't very common.
View GitHub Profile
@olegchursin
olegchursin / example.jsx
Created May 1, 2019 05:48 — forked from bvaughn/LICENSE.md
Advanced example for manually managing subscriptions in an async-safe way using hooks
import React, { useMemo } from "react";
import useSubscription from "./useSubscription";
// In this example, "source" is an event dispatcher (e.g. an HTMLInputElement)
// but it could be anything that emits an event and has a readable current value.
function Example({ source }) {
// In order to avoid removing and re-adding subscriptions each time this hook is called,
// the parameters passed to this hook should be memoized.
const subscription = useMemo(
() => ({
@olegchursin
olegchursin / Readme.md
Created February 18, 2018 03:39 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@olegchursin
olegchursin / Readme.md
Created February 18, 2018 03:39 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@olegchursin
olegchursin / .gitignore
Created December 15, 2015 22:25 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@olegchursin
olegchursin / contact.css
Created November 10, 2015 15:41 — forked from jongrover/contact.css
Front-end / Back-end Validated Email Mailer Form Submission Solution using HTML5, PHP5, JavaScript, and jQuery
input.error, textarea.error {
border: 1px solid red;
}
span.error {
display: none;
color: red;
}