Using a hypothetical museum floorplan to demonstrate hover and click interactivity, as well as fitBounds.
package org.testcontainers.containers; | |
import com.couchbase.client.core.utils.Base64; | |
import com.couchbase.client.java.CouchbaseCluster; | |
import com.couchbase.client.java.env.CouchbaseEnvironment; | |
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | |
import org.testcontainers.containers.traits.LinkableContainer; | |
import org.testcontainers.containers.wait.HttpWaitStrategy; | |
import java.io.DataOutputStream; |
class ControllerWithBasicAuth extends Controller { | |
private val WithBasicAuth = new BasicAuthAction("user", "pass") | |
def index = WithBasicAuth { | |
Ok("Correct basic auth credentials") | |
} | |
} |
import cats.{Id,Monad} | |
import cats.state.State | |
import cats.std.function._ | |
import scala.language.higherKinds._ | |
// Call Example.example.run to see the example running | |
object Example { | |
type MyState[A] = State[Int, A] |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install gcc-5 g++-5 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 |
#Requests from outside | |
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080 | |
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3443 | |
#Requests from localhost | |
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3080 | |
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 3443 |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import akka.pattern.after | |
import akka.actor.Scheduler | |
/** | |
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown, | |
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through | |
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure. |