Skip to content

Instantly share code, notes, and snippets.

View jslatts's full-sized avatar

Justin Slattery jslatts

View GitHub Profile
@jslatts
jslatts / Dockerfile
Last active August 29, 2015 14:05
Dockerfile for node.js app
# Dockerfile to run node app
# VERSION 1 - EDITION 2
# Base image used is Ubuntu 14.04 LTS
FROM ubuntu:14.04
MAINTAINER me
# Install wget
RUN apt-get update && apt-get install -y \
@jslatts
jslatts / CommentStore.js
Last active August 29, 2015 14:17
Example RefluxJS Store
'use strict';
//External
var Reflux = require('reflux');
//Local
var CommentActions = require('./CommentActions');
var CommentStore = Reflux.createStore({
@jslatts
jslatts / keybase.md
Created December 14, 2015 20:58
keybase.md

Keybase proof

I hereby claim:

  • I am jslatts on github.
  • I am jslatts (https://keybase.io/jslatts) on keybase.
  • I have a public key whose fingerprint is BEAC D369 6650 0EA1 E5BD 8E0A BABD ED49 FC7B 0E86

To claim this, I am signing this object:

@jslatts
jslatts / requiresToImports.js
Created April 14, 2016 21:35 — forked from dmnd/requiresToImports.js
Converts commonJS requires to es6 imports
// converts commonJS requires to es6 imports
// var foo = require('foo');
// ->
// import foo from 'foo';
//
// jscodeshift -t requiresToImports.js src/**/*.js*
'use strict';
module.exports = function(fileInfo, api) {
var j = api.jscodeshift;
@jslatts
jslatts / ReactConfig.cs
Last active May 17, 2021 05:44
webpack config for React.NET with server side bundle
ReactSiteConfiguration.Configuration.AddScriptWithoutTransform("~/wwwroot/ng-server.bundle.js");
ReactSiteConfiguration.Configuration.JsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings
{
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
};
// Don't use slower IE engine
ReactSiteConfiguration.Configuration.AllowMsieEngine = false;
@jslatts
jslatts / app.js
Last active December 8, 2019 22:19
Utility to bind selectors to a slice of state. Helpful for keeping things DRY when colocating selectors and reducers
// Example of usage
import { selectors } from './rootReducer';
import { selectors } from '../../reducers/rootReducer';
const mapStateToProps = (state: State, ownProps: any) => ({
theseObjects: selectors.getTheseObjects(state),
thoseObjects: selectors.getThoseObjects(state),
showSomethinginUi: selectors.getSomethingFromUiSelectors(state),