Skip to content

Instantly share code, notes, and snippets.

View wycliffepeart's full-sized avatar
🏠
Working from home

Wycliffe Peart wycliffepeart

🏠
Working from home
View GitHub Profile
@wycliffepeart
wycliffepeart / beautiful.rest.api.docs.in.markdown.md
Created February 7, 2024 23:01 — forked from azagniotov/beautiful.rest.api.docs.in.markdown.md
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.

1. Create a dedicated project to host your Maven repository on Github

For example, you can have a mvn-repo project created.

2. Clone the remote mvn-repo into your local folder

For example, into ~/workspace/mvn-repo folder

3. Build your project and deploy it into your local folder.

In order to do this, you will need to have the following snippet in your pom.xml file

@wycliffepeart
wycliffepeart / HttpClientAutoConfiguration.java
Created March 14, 2021 16:44 — forked from jkuipers/HttpClientAutoConfiguration.java
Spring Boot auto-configuration example for an Apache Components HTTP client and its usage in all RestTemplates created by the RestTemplateBuilder, plus trace logging support
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateCustomizer;
@wycliffepeart
wycliffepeart / jwtRS256.sh
Created November 18, 2020 13:33 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@wycliffepeart
wycliffepeart / NestedScrollViewLoadMore
Created August 21, 2020 07:33 — forked from IkhwanSI13/NestedScrollViewLoadMore
load more data in NestedScrollView with NotificationListener
import 'package:cartenz_djp/style/colors.dart';
import 'package:cartenz_djp/widget/override/customTabs.dart' as Tabs;
import 'package:flutter/material.dart';
class ExampleWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() => ExampleState();
}
class ExampleState extends State<ExampleWidget> {
@wycliffepeart
wycliffepeart / input placeholder.css
Created December 22, 2017 02:51
form input placeholder color
input {
outline: none;
padding: 12px;
border-radius: 3px;
border: 1px solid black;
}
::-webkit-input-placeholder { /* Chrome */
color: red;
transition: opacity 250ms ease-in-out;
}
@wycliffepeart
wycliffepeart / toolbar.xml
Created December 4, 2017 12:59
Toolbar Elevation on Pre-lollipop Devices.
<!-- Create a new XML file toolbar.xml in directory res/layouts -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
@wycliffepeart
wycliffepeart / Javascript-FileUploader.js
Last active June 27, 2016 20:18
Javascript Sending form data using iframe
"use strict";
document.getElementById("file-upload-form").addEventListener("submit", (e) => {
e.preventDefault();
this.inputElement = [];
this.iframeName = "uploader-facade";
this.form = document.createElement("form");
this.iframe = document.createElement("iframe");
@wycliffepeart
wycliffepeart / merge-object.js
Last active December 8, 2020 03:32
Javascript Object.assign Alternative . The mergeObject() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
function mergeObject(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key];
}
}
}
return target;