Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View vdelacou's full-sized avatar

Vincent DELACOURT vdelacou

View GitHub Profile
@vdelacou
vdelacou / UploadFileComponent.tsx
Last active May 9, 2022 14:09
React / Typescript / Material UI / Upload file / Custom Button / Async /
// import .....
const inputUploadFile: CSSProperties = {
display: 'none',
};
const buttonUploadFile: CSSProperties = {
margin: 8,
};
@vdelacou
vdelacou / update.sh
Created September 14, 2017 08:03
Update global library yarn, npm, chocolatey in windows
#!/bin/sh
choco upgrade all -y
npm install npm@latest -g
npm update -g
yarn global upgrade
@vdelacou
vdelacou / react-vis.d.ts
Created March 18, 2018 10:42
Typescript Definition for react-vis
declare module "react-vis" {
export class AbstractSeries extends React.Component<PropsAbstractSeries> {
}
export class ArcSeries extends React.Component<PropsArcSeries> {
}
@vdelacou
vdelacou / seelix_api_part_01.jh
Created June 7, 2018 04:18
Simple ATS JHipster JDL
/**
* A job description
*/
entity JobDescription {
/** The title for the job */
title String required,
/** The experience needed */
yearExperience Long required min(0),
/** When the job is available */
@vdelacou
vdelacou / ApplicationProperties.java
Created June 7, 2018 06:12
Add Auth0 Properties to JHipster spring boot application
package com.seelix.api.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Properties specific to Seelix.
* <p>
* Properties are configured in the application.yml file.
* See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
*/
@vdelacou
vdelacou / TokenProvider.java
Last active June 8, 2018 08:26
Change TokenProvider in JHipster app to add Auth0
package com.seelix.api.security.jwt;
import java.security.interfaces.RSAPublicKey;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
@vdelacou
vdelacou / JWTFilter.java
Created June 7, 2018 07:11
Change JWT Filter with optional Authentication
package com.seelix.api.security.jwt;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
@vdelacou
vdelacou / Auth0.ts
Last active June 14, 2018 09:01
Create class for instance of auth0
import Auth0Lock from 'auth0-lock';
export default class Auth {
lock = new Auth0Lock(
'MVmsdXMGSS2JusuH82DeNAErxtoTmmir',
'seelix.eu.auth0.com',
{
auth:
{
audience: 'https://seelix-api.com',
@vdelacou
vdelacou / login.tsx
Created June 14, 2018 09:06
Change Jhipster login to work with Auth0
import * as React from 'react';
import { connect } from 'react-redux';
import { RouteComponentProps } from 'react-router-dom';
import { Storage } from 'react-jhipster';
import { IRootState } from 'app/shared/reducers';
import { getSession } from 'app/shared/reducers/authentication';
import Auth0 from 'app/config/auth0';
export interface ILoginProps extends StateProps, DispatchProps, RouteComponentProps<{}> { }
@vdelacou
vdelacou / logout.tsx
Created June 14, 2018 09:12
Change jhipster Logout with Auth0
import * as React from 'react';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import { IRootState } from 'app/shared/reducers';
import { logout } from 'app/shared/reducers/authentication';
import Auth0 from 'app/config/auth0';
export interface ILogoutProps extends StateProps, DispatchProps { }