Skip to content

Instantly share code, notes, and snippets.

View fedorovsky's full-sized avatar
🎯
Focusing

Anton Fedorovskyi fedorovsky

🎯
Focusing
  • Plarium
  • Ukraine
View GitHub Profile
@er-ant
er-ant / tsconfig-all.js
Last active April 29, 2024 10:27
tsconfig.json with comments and explanations
{
// Config for IDE to reload
"compileOnSave": true,
"exclude": [
// Specifies an array of filenames or patterns that should be skipped when resolving include.
// Default:
// ["node_modules", "bower_components", "jspm_packages"], plus the value of outDir if one is specified.
"**/*.spec.ts",
"node_modules"
],
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active June 20, 2024 13:06
Install NVM, Node.js, Yarn via Homebrew
@bengotow
bengotow / linkify-plugin.js
Last active December 23, 2022 15:33
A Linkify plugin for DraftJS that creates / syncs entities on the fly
import React from 'react';
import { RichUtils, Modifier, EditorState, SelectionState } from 'draft-js';
function isURL(text) {
return text.startsWith('http://'); // insert your favorite library here
}
/*
Function you can call from your toolbar or "link button" to manually linkify
the selected text with an "explicit" flag that prevents autolinking from
changing the URL if the user changes the link text.
@milankorsos
milankorsos / redux-actions.ts
Last active November 10, 2022 10:58
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));