Skip to content

Instantly share code, notes, and snippets.

Avatar

JRichardsz jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / beautiful.rest.api.docs.in.markdown.md
Created Aug 10, 2022 — forked from azagniotov/beautiful.rest.api.docs.in.markdown.md
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
View beautiful.rest.api.docs.in.markdown.md
View mocha run programatically.js
var Mocha = require('mocha');
var path = require('path');
var fs = require('fs').promises;
const glob = require("glob");
var mocha = new Mocha({});
(async() => {
var listFiles = function () {
View mail snippet - nodejs microsoft.js
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
host: 'smtp.office365.com', // Office 365 server
port: 587, // secure SMTP
secure: false, // false for TLS - as a boolean not string - but the default is false so just remove this completely
auth: {
user: process.env.username,
pass: process.env.password
},
View git snippets.md

workspace_path=$(pwd) echo "workspace_path:$workspace_path"

cd $workspace_path git add --all

echo "CUSTOM_GIT_AUTHOR=$CUSTOM_GIT_AUTHOR" if [[ -n "$CUSTOM_GIT_AUTHOR" ]] then git commit --author="$CUSTOM_GIT_AUTHOR" -m "$1"

@jrichardsz
jrichardsz / elementary_script_v1.sh
Last active Aug 7, 2022
configure elementary apps
View elementary_script_v1.sh
cd /tmp
#############
# Install Atom
#############
curl -sL https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt-get update
sudo apt-get install atom
@jrichardsz
jrichardsz / linux prompt customization.md
Last active Aug 6, 2022
linux prompt customization
View linux prompt customization.md

hide path

#1
export PS1="\u >"

#2
export PS1="\u :"
@jrichardsz
jrichardsz / ClassScanner.java
Last active Aug 5, 2022 — forked from skempken/Detector.java
Find all annotated classes in a package using Spring
View ClassScanner.java
import java.lang.annotation.Annotation;
import java.util.LinkedList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.web.context.support.StandardServletEnvironment;
@jrichardsz
jrichardsz / docker manage.md
Last active Aug 5, 2022
mysql cli snippets, mysql import , mysql export, mysql truncate
View docker manage.md

copy script

docker cp /tmp/workspace/manage.sh my_mysql_container:/usr/local/bin/

copy dump

docker cp /tmp/workspace/dump.sql my_mysql_container:/tmp
View PayPal API Design Patterns
/
# API Design Patterns And Use Cases
This document lists various useful patterns for API design. We encourage API developers to consider the following patterns as a guide while designing APIs for services.
### Document Semantics, Formatting, and Naming
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
View PayPal API Standards
# API Design Guidelines
# Introduction
The PayPal platform is a collection of reusable services that encapsulate well-defined business capabilities. Developers are encouraged to access these capabilities through Application Programming Interfaces (APIs) that enable consistent design patterns and principles. This facilitates a great developer experience and the ability to quickly compose complex business processes by combining multiple, complementary capabilities as building blocks.
PayPal APIs follow the [RESTful][0] architectural style as much as possible. To support our objectives, we have developed a set of rules, standards, and conventions that apply to the design of RESTful APIs. These have been used to help design and maintain hundreds of APIs and have evolved over several years to meet the needs of a wide variety of use cases.
We are sharing these guidelines to help propagate good API design practices in general. We have pulled extensively from the broader community and believe that it is importan