Skip to content

Instantly share code, notes, and snippets.

import scala.util.{Left, Right}
case class Name(value: String) extends AnyVal {
def +(s: Name) = Name(this.value + s)
override def toString: String = value
}
implicit def strToName(s: String) = Name(s)
package demo
/**
* todo
*/
object FutureDemoApp extends App {
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
object supporting {
import scala.util.Random
val random = new Random()
def fiftyFifty[T](a: T): Option[T] = if (Random.nextBoolean) Some(a) else None
def sendTweet(h: String) = println(s"sending tweet to $h")
def sendMail(e: String) = println(s"sending email to $e")
object demo1 {
case class PersonalInfo(email: String)
<!-- host2 -->
<servers>
<server name="server-one" group="Group1">
<socket-bindings port-offset="100"/>
</server>
<server name="server-two" group="Group2">
<socket-bindings port-offset="200"/>
package demo.util;
import javassist.util.proxy.MethodFilter;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
// with some inspiration from https://jsfiddle.net/uggmnho5/4/
const base = url.substr(0,url.lastIndexOf("/")) + "/";
$.get(url).then((htmlText) => {
htmlText = htmlText.replace(/src=("|\')(?!https?:|\/)/g, 'src=$1' + base) // expand to to other needs
const myDocURL = URL.createObjectURL(new Blob([htmlText], {
type: 'text/html'
}));
@rparree
rparree / proxy.yaml
Last active July 24, 2018 11:16
Proxy settings
- hosts: localhost
vars:
proxy_address_without_credentials: http://{{host}}:{{port_no}}
_proxy_address_with_credentials: http://{{username}}:{{password}}@{{host}}:{{port_no}}
proxy_address_with_credentials: "{{proxy_address_without_credentials if username=='' else _proxy_address_with_credentials }}"
vars_prompt:
- name: host
prompt: "proxy host"
private: no
- name: port_no
const initAnimateCSSSupport = () => {
const ACTION = Object.freeze({
START: Symbol("start"),
STOP: Symbol("stop"),
});
const updateAnimateClasses = (action) => (node) => {
const classes = node.getAttribute('data-animate').split(" ");
const fn = action === ACTION.START ? node.classList.add : node.classList.remove;
  • Delete your minikube 
$ minikube delete
  • Create a new cluster
$ minikube start --kubernetes-version v1.14.7 --vm-driver virtualbox \
  --cpus=2 --memory=8196 --insecure-registry=nexus-docker.local --extra-config=kubelet.authentication-token-webhook=true \
  --extra-config=scheduler.address=0.0.0.0 \

Create a new minikube cluster

minikube -p networking start --network-plugin=cni --kubernetes-version v1.15.6 --memory=4096 

It won't start-up completely. Just do a minikube -p networking stop when it has completed.

Update the country-rest service