Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Raible mraible

View GitHub Profile
@mraible
mraible / mfr.sh
Last active Apr 3, 2022
Try JHipster's microfrontend support for React
View mfr.sh
npm install -g generator-jhipster@7.8
take ~/Downloads/mfr
jhipster jdl reactive-mf --fork # use --client-framework=angularX|vue for other frameworks
@mraible
mraible / pom.xml.patch
Last active Mar 23, 2022
JHipster modified for Java on M1
View pom.xml.patch
diff --git a/pom.xml b/pom.xml
index 7b8cffc..3640692 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,7 +79,6 @@
<maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
- <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
View gist:58f563d749c89ab991d17a6f2786af33
http://www.slideshare.net/HubSpot/what-would-steve-do-10-lessons-from-the-worlds-most-captivating-presenters
1. Craft a story that captures both heart and mind.
Beginning - Middle - End
2. Create slides that lead your audience to say "YES!".
3. Start by telling us why we should care.
@mraible
mraible / App.test.js
Created Nov 24, 2020
App.test.js from CRA with Okta React 4.0.0
View App.test.js
import React from 'react';
import ReactDOM from 'react-dom';
import { act } from 'react-dom/test-utils';
import App from './App';
jest.mock('@okta/okta-auth-js', () => {
return {
OktaAuth: jest.fn(() => {
return {
userAgent: 'okta/okta-auth-js',
@mraible
mraible / gist:498df295e7cd8d940e42b2004ab30a83
Created May 7, 2020
pack with Heroku static buildpack
View gist:498df295e7cd8d940e42b2004ab30a83
$ pack build react-pack --builder=heroku/buildpacks --buildpack https://cnb-shim.herokuapp.com/v1/heroku-community/static
latest: Pulling from heroku/buildpacks
Digest: sha256:14c60798f3cf5bcbab867213add52d134af3aaad3064062cafb25177cd48f5ed
Status: Image is up to date for heroku/buildpacks:latest
18: Pulling from heroku/pack
Digest: sha256:a3cb71855f7e399ad079f6f0fa5feb6cc93446a332d9b8ef535ca9a17dac92cf
Status: Image is up to date for heroku/pack:18
Downloading from https://cnb-shim.herokuapp.com/v1/heroku-community/static
3.35 MB/3.35 MB
===> DETECTING
@mraible
mraible / Dockerfile
Created May 3, 2020
Dockerfile and nginx.conf that supports Angular's path-based routing
View Dockerfile
FROM node:14.1-alpine AS builder
WORKDIR /opt/web
COPY package.json package-lock.json ./
RUN npm install
ENV PATH="./node_modules/.bin:$PATH"
COPY . ./
RUN ng build --prod
@mraible
mraible / output.md
Created Apr 17, 2020
Spring Boot + OAuth 2.0 with Okta in 30 seconds
View output.md
~ curl https://start.spring.io/starter.zip -d dependencies=web,okta -d baseDir=bootiful-oauth | tar -xzvf -
cd bootiful-oauth
mvn com.okta:okta-maven-plugin:setup
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 57642  100 57598  100    44  81123     61 --:--:-- --:--:-- --:--:-- 81071
x bootiful-oauth/
x bootiful-oauth/.mvn/
x bootiful-oauth/.mvn/wrapper/
@mraible
mraible / angular-size.md
Last active Apr 24, 2022
Angular App Size
View angular-size.md

Angular 8:

  • ES5: 62 + 683 + 6.2 + 176 + 8500
  • ES2015: 50 + 264 + 6.2 + 174 + 7100

With AOT:

  • ES5: 781 + 123 + 1.5 = 905.5
  • ES2015: 664 + 36 + 1.5 = 701.5
@mraible
mraible / HomeController.java
Created Jan 16, 2020
Spring Security OIDC Demo
View HomeController.java
@RestController
class HomeController {
@GetMapping("/")
public String hello(@AuthenticationPrincipal OidcUser user) {
return "Hello, " + user.getFullName();
}
}
View search.component.spec.ts
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SearchComponent } from './search.component';
import { MockSearchService } from '../shared/search/mocks/search.service.mock';
import { MockActivatedRoute } from '../shared/search/mocks/routes';
import { SearchService } from '../shared';
import { ActivatedRoute } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';