Skip to content

Instantly share code, notes, and snippets.

View puppybits's full-sized avatar

Bobby puppybits

View GitHub Profile
@puppybits
puppybits / Dockerfile
Last active June 12, 2017 17:37
<10s Docker/NPM build & develop from a docker container
FROM node
RUN mkdir -p /app
WORKDIR /app
# .deps.json will only bust the cache when the package.json dependencies change
COPY .deps.json /app/package.json
RUN npm install
# cache will almost always bust here, but it's only copying files
@puppybits
puppybits / docker-compose.yml
Last active September 5, 2020 08:35 — forked from andrefreitas/docker-compose.yml
sentry docker-compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
const PurchaseComplete = (props) =>
(<div className="purchase-complete">
<h2>Thanks!</h2>
<p>
Thank you for your purchase of {formatPrice(this.state.total)}.
We’ll send you a receipt shortly.
</p>
<p>
<button
className="cta-button outlined-button"
{
"universal": true,
"embed": true,
"bower": true,
"commonsChunk": true,
"longTermCaching": false,
"separateStylesheet": false,
"minimize": false,
"devtool": "cheap-module-eval-source-map",
"devServer": true,
@puppybits
puppybits / config..js
Created February 8, 2016 00:54
Webpack high-level config. Megatome: React/Webpack Starter Kit. https://github.com/Levelmoney/generator-megatome
{
isomorphic: true, /* Create a version to run server-side. default: false. unless running the npm run render command. */
embed: true, /* ignore all chunking and include all images, css, JSON, JS and other assests into a single file. Great for CMS */
bower: true, /* search for bower components as well.*/
commonsChunk: true, /* Split code in multiple chunks to allow the user to only download code that is used on that page. */
longTermCaching: false, /* Add a hash to the file name. Unless the hash changes, the browser wont download it again. */
separateStylesheet: false, /* Separate CSS from JS. default: false. This means less files to download separately and allow hot swapping to work for CSS. */
minimize: false, /* Minify code. Default for production build is true. */
devtool: "cheap-module-eval-source-map", /* Create source maps. Dev source maps build only what is needed. Production source maps go into the /build folder by deafult so they are never deployed to the end-users. */
devServer:
var globals = {
React: 'react',
ReactDom: 'react-dom',
ReactRouter: 'react-router'
}
...
{
entry: {
app: ['./src/bootstrap.js'],
let { Router, Route } = ReactRouter;
let App = require('App');
// routes
var routes = {
path: '/',
component: App,
onEnter: (router, replaceWith) => {
if (router.location.pathname === '/') {
replaceWith(null, '/one');
@puppybits
puppybits / hello-react.html
Created January 7, 2016 18:34
A React Hello World without JSX, ES6, transpiling, tooling or anything getting in the way
<html>
<body>
<div id="app"></div>
<script src="//fb.me/react-0.14.3.js"></script>
<script src="//fb.me/react-dom-0.14.3.js"></script>
<script>
var el = React.createElement;
var myView = React.createClass({
render: function(){
return el('h1', {color:'#F00'}, "Hello React");
@puppybits
puppybits / BankItem-v0.js
Last active April 21, 2018 13:16
ClojureScript & React sample code
/* Basic element to show the state of a single bank connection */
createView({
contextTypes: {
triforce: React.PropTypes.object.isRequired
},
getDefaultProps: function(){
return {bank: {}};
},
getInitialState: function(){
@puppybits
puppybits / Docerfile.cacheNPM
Created September 25, 2015 18:10
Super fast JS Docker images by caching NPM modules that haven't changed
FROM library/node
MAINTAINER bobby@levelmoney.com
RUN mkdir /.npm
RUN mkdir /app
# cache (and skip if no changes) to the node_modules
WORKDIR /.npm
ADD package.json /.npm/package.json
# Set the version in the cache folder to 0.