Skip to content

Instantly share code, notes, and snippets.

View themre's full-sized avatar

Marko Trebizan themre

View GitHub Profile
@threepointone
threepointone / after.js
Last active February 4, 2021 09:30
converted a function to a generator; simpler, more efficient, cooler.
// recursively get all files in a folder
function* getAllFiles(dirPath: string): Iterable<string> {
for (const file of fs.readdirSync(dirPath)) {
const pathToCheck = path.join(dirPath, file);
if (fs.statSync(pathToCheck).isDirectory()) {
if (file !== 'node_modules') {
yield* getAllFiles(pathToCheck);
}
} else {
yield pathToCheck;
@okonet
okonet / lightning_talk_proposal.md
Last active April 10, 2018 10:09
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.

@bummzack
bummzack / NavigationPrompt.jsx
Created June 28, 2017 19:33
A replacement component for the react-router `Prompt`.
import React from 'react';
import {withRouter} from 'react-router-dom';
import PropTypes from 'prop-types';
/**
* A replacement component for the react-router `Prompt`.
* Allows for more flexible dialogs.
*
* @example
* <NavigationPrompt when={this.props.isDirty}>
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!