Skip to content

Instantly share code, notes, and snippets.

View mightyhorst's full-sized avatar
🎯
Focusing

Mitch mightyhorst

🎯
Focusing
View GitHub Profile
@mightyhorst
mightyhorst / connect.js
Created October 31, 2019 22:39 — forked from gaearon/connect.js
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@mightyhorst
mightyhorst / Dockerfile.cy
Created October 23, 2019 07:18
Docker, Cypress and CircleCI
FROM cypress/base:12.6.0 as testse2e
WORKDIR /usr/src/app
COPY . .
RUN npx cypress install
RUN npx cypress verify
RUN npx cypress run --spec **/*.feature
@mightyhorst
mightyhorst / ecr.yml
Last active October 21, 2019 12:14
AWS Cloudformation for deploying NodeJs Docker onto ECR
#
# Repo key: AwsEcrDockerRepo
# Repo name: "docker-repo-of-doom"
# Repo ARN: AwsEcrDockerRepoArn
# ARN is the AWS Resource name
#
AWSTemplateFormatVersion: "2010-09-09"
Description: ECR repo for Developer Test
#
@mightyhorst
mightyhorst / Dockerfile.dev
Last active October 20, 2019 08:55
Docker multi build for NodeJs
#############################
#
# Build
#
FROM node:12-alpine as builder
WORKDIR /usr/src/app
COPY package* ./
RUN ["yarn", "install"]
COPY . /usr/src/app
@mightyhorst
mightyhorst / bitbucket-pipelines.yml
Created October 9, 2019 03:19 — forked from jincod/bitbucket-pipelines.yml
Docker deployment using Bitbucket Pipelines and Heroku
pipelines:
default:
- step:
name: build and publish docker image
services:
- docker
caches:
- docker
script:
- docker build -t $APP_NAME .
@mightyhorst
mightyhorst / keycloak.sh
Created April 19, 2019 01:57 — forked from luciddreamz/keycloak.sh
Keycloak Admin API Rest Example: Get User
#!/bin/bash
# requires https://stedolan.github.io/jq/download/
# config
KEYCLOAK_URL=http://localhost:8080/auth
KEYCLOAK_REALM=realm
KEYCLOAK_CLIENT_ID=clientId
KEYCLOAK_CLIENT_SECRET=clientSecret
USER_ID=userId
@mightyhorst
mightyhorst / is_installed.sh
Created March 4, 2019 05:57 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@mightyhorst
mightyhorst / Error handling flow
Last active January 25, 2019 00:14
Error Handling
### Error flow
try
retry
on succeeded write operation add to rollback/undo log
catch
error code swicth case
send back Error Model:
code: 500
urn: io.kitset.{entity}
key: validation.{field}
@mightyhorst
mightyhorst / Beam Experience
Last active January 16, 2019 02:09
CV Experience
## Beam Energy, Sydney — Lead Fullstack Developer (Angular 6, Swift iOs, NodeJs, AWS)
#### November 2017 - October 2018
Beam Energy is an award winning innovative startup of 5 people which completely automatea the procurement of solar for huge industrial consumers of electricity, in particular factories and meat works, using IoT and machine learning blended with advanced engineering principles.
The problem they are solving is that a large factory like Pepsi bottling facilities uses an extraordinary amount of power from the grid, which accordingly requires a blend of green energy sources, a large amount of real estate for solar panels, fallback for outages, a significant investment of capex, world class solar engineers, regulatory red tape and long term buy in from the leadership. This process typically involves energy analysts to collect data and build engineering models forecasting usage throughout the day, financial analysis of the cost/benefit of systems that will meet this usage and a business case to
@mightyhorst
mightyhorst / README.md
Created October 6, 2018 07:06 — forked from xaviervia/README.md
Sketch 43 files JSON types