This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>...</title> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: this adds a filename and line number to winston's output | |
// Example output: 'info (routes/index.js:34) GET 200 /index' | |
var winston = require('winston') | |
var path = require('path') | |
var PROJECT_ROOT = path.join(__dirname, '..') | |
var logger = new winston.logger({ ... }) | |
// this allows winston to handle output from express' morgan middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm running into an issues with the latest version of Electron + Webpack. | |
If I try to use the 'electron-renderer' target, webpack compilation fails because it attempts to use native node dependencies from one of my npm modules let's call it "child-module". | |
{ | |
// ... | |
target: 'electron-renderer' | |
} | |
child-module's package.json: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @class GLCompositeNode | |
* | |
* Composites all children simulating the standard blend function: | |
* | |
* gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA). | |
*/ | |
import React, { PureComponent } from 'react' | |
import PropTypes from 'prop-types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clone and rename base boilerplate repo | |
git clone https://github.com/transitive-bullshit/react-modern-library-boilerplate.git | |
mv react-modern-library-boilerplate react-poop-emoji | |
cd react-poop-emoji | |
rm -rf .git | |
# replace boilerplate placeholders with your module-specific values | |
mv README.template.md README.md | |
# find and replace react-modern-library-boilerplate with react-poop-emoji everywhere |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run example to start developing your new component against | |
npm link # the link commands are important for local development | |
npm install # disregard any warnings about missing peer dependencies | |
npm start # runs rollup with watch flag | |
# (in another tab, run the example create-react-app) | |
cd example | |
npm link react-poop-emoji | |
npm install | |
npm start # runs create-react-app hot-reload dev server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# be sure to update docs | |
vim README.md | |
vim package.json | |
# init and push git repo | |
git init | |
git add * | |
git commit -am "init" | |
# add git remote and push to remote github repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update dependencies, devDependencies, and peerDependencies | |
vim package.json | |
vim rollup.config.js | |
# build dist and publish to npm | |
npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
string value | |
Array<Node> neighbors | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph { | |
Array<int> nodes; | |
Array<[ int, int ]> edges | |
} |