Skip to content

Instantly share code, notes, and snippets.

View transitive-bullshit's full-sized avatar
👋
Searching for AGI

Travis Fischer transitive-bullshit

👋
Searching for AGI
View GitHub Profile
@transitive-bullshit
transitive-bullshit / index.html
Created July 29, 2015 08:21
Ionic example index
<!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">
@transitive-bullshit
transitive-bullshit / logger.js
Last active February 18, 2024 21:32
winston logger with filename:linenumber
// 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
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:
/**
* @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'
@transitive-bullshit
transitive-bullshit / walkthrough-0.sh
Created September 23, 2017 06:43
react-modern-library-boilerplate-0
# 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
@transitive-bullshit
transitive-bullshit / walkthrough-1.sh
Created September 23, 2017 06:44
react-modern-library-boilerplate-1
# 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
@transitive-bullshit
transitive-bullshit / walkthrough-2.sh
Last active September 23, 2017 06:50
react-modern-library-boilerplate-2
# 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
@transitive-bullshit
transitive-bullshit / walkthrough-3.sh
Last active September 23, 2017 06:53
react-modern-library-boilerplate-3
# update dependencies, devDependencies, and peerDependencies
vim package.json
vim rollup.config.js
# build dist and publish to npm
npm publish
class Node {
string value
Array<Node> neighbors
}
class Graph {
Array<int> nodes;
Array<[ int, int ]> edges
}