Skip to content

Instantly share code, notes, and snippets.

View keeplearningandtrying's full-sized avatar

keeplearningandtrying

View GitHub Profile
@keeplearningandtrying
keeplearningandtrying / .block
Created July 23, 2023 23:56 — forked from mbostock/.block
Force-Directed Graph
license: gpl-3.0
height: 600
redirect: https://observablehq.com/@d3/d3-force-directed-graph
https://github.com/kubernetes/minikube/releases
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.25.1/minikube-darwin-amd64
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.3/bin/darwin/amd64/kubectl
curl -L https://github.com/istio/istio/releases/download/1.12.2/istio-1.12.2-osx.tar.gz | tar xz
@keeplearningandtrying
keeplearningandtrying / postman-pre-request.js
Created August 22, 2021 08:33 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@keeplearningandtrying
keeplearningandtrying / CustomSimulation.scala
Created May 2, 2021 14:03 — forked from mburrows02/CustomSimulation.scala
Gatling simulation with dynamic scenarios and injection profiles
package test
import io.gatling.core.Predef._
import io.gatling.core.structure.PopulatedScenarioBuilder
import io.gatling.core.controller.inject.InjectionStep
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import scala.concurrent.duration._
import scala.collection.mutable.ArraySeq
import org.json.JSONArray;
import org.json.JSONObject;
@keeplearningandtrying
keeplearningandtrying / index.html
Created January 13, 2021 15:05 — forked from looselytyped/index.html
Containers in 3 weeks — Week 1 (nginx test file)
<!DOCTYPE html>
<html lang="en">
<head>
<!-- BLATANTLY STOLEN FROM https://getbootstrap.com/docs/4.1/examples/cover/ -->
<title>Docker Workshop</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
/*
@keeplearningandtrying
keeplearningandtrying / Setup.md
Created January 13, 2021 15:05 — forked from looselytyped/Setup.md
Containers in 3 weeks - Set up

Containers in 3 weeks — Week 1/2 setup

Installation

You will need Docker installed! Here is a link to get you started. Proceed after you are done installing.

Warm up your engines!

=== Install Spring STS on Mac OS X El Capitan using HomeBrew

First, install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then install cask (https://github.com/caskroom/homebrew-cask)

@keeplearningandtrying
keeplearningandtrying / UserService.java
Created April 30, 2020 19:02 — forked from mattrasband/UserService.java
Example of Spring 4.2's @TransactionalEventListener
@Service
@Slf4j
public class UserService {
private final ApplicationEventPublisher applicationEventPublisher;
private final UserRepository userRepository;
UserService(ApplicationEventPublisher applicationEventPublisher,
UserRepository userRepository) {
this.applicationEventPublisher = applicationEventPublisher;
this.userRepository = userRepository;
@keeplearningandtrying
keeplearningandtrying / HttpClientAutoConfiguration.java
Created January 20, 2020 03: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;
@keeplearningandtrying
keeplearningandtrying / HttpClientProperties.java
Created January 20, 2020 03:44 — forked from jkuipers/HttpClientProperties.java
Type-safe configuration class for the HttpClientAutoConfiguration sample
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("http.client")
public class HttpClientProperties {
private int connectionTimeoutInMillis = 1_000;
private int readTimeoutInMillis = 10_000;
/** Used to configure both the default max per route as well as the maximum total connections. */
private int maxConnections = 200;
/**
* Configures a LoggingClientHttpRequestInterceptor and a BufferingClientHttpRequestFactory,