start new:
tmux
start new with session name:
tmux new -s myname
| Pipeline pipeline = jedis.pipelined(); | |
| long start = System.currentTimeMillis(); | |
| for (int i = 0; i < 100000; i++) { | |
| pipeline.set("" + i, "" + i); | |
| } | |
| List<Object> results = pipeline.execute(); | |
| long end = System.currentTimeMillis(); | |
| System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds"); |
| #!/usr/bin/env ruby | |
| # Usage: gitio URL [CODE] | |
| # | |
| # Turns a github.com URL | |
| # into a git.io URL | |
| # | |
| # Copies the git.io URL to your clipboard. | |
| url = ARGV[0] | |
| code = ARGV[1] |
| package com.vast.example | |
| import java.net.InetSocketAddress | |
| import java.util.UUID | |
| import java.util.concurrent.{Executors, TimeUnit} | |
| import com.google.common.base.Splitter | |
| import com.twitter.finagle.http.Http | |
| import com.twitter.finagle.builder.{Server, ServerBuilder} | |
| import com.twitter.finagle.service.TimeoutFilter | |
| import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException} |
| // my response to https://groups.google.com/forum/?fromgroups#!searchin/play-framework/cake/play-framework/LQ2y40QNZaE/qvRFw5of-rQJ | |
| import play.api._ | |
| import play.api.mvc._ | |
| // Domain object | |
| case class User(id: String, name: String) | |
| // Trait defining the service component | |
| trait UserServiceComponent { |
| case class ReaderWriterStateT[R, W, S, F[_], A]( | |
| run: (R, S) => F[(W, A, S)] | |
| ) { | |
| def map[B](f: A => B)(implicit F: Functor[F]) | |
| : ReaderWriterStateT[R, W, S, F, B] = | |
| ReaderWriterStateT { | |
| case (r, s) => F.map(run(r, s)) { | |
| case (w, a, s) => (w, f(a), s) | |
| } | |
| } |
| object RWS extends App { | |
| trait Pointed[P[_]] { | |
| def point[A](a: A): P[A] | |
| } | |
| trait PointedFunctor[PF[_]] extends Pointed[PF] with Functor[PF] | |
| implicit def listIsMonoid[A]: Monoid[List[A]] = new Monoid[List[A]] { | |
| def id: List[A] = Nil |
| import java.util.Properties | |
| import kafka.server.KafkaServer | |
| import kafka.server.KafkaConfig | |
| import kafka.producer.ProducerConfig | |
| import kafka.producer.Producer | |
| import kafka.message.Message | |
| import kafka.producer.ProducerData | |
| import kafka.consumer.ConsumerConfig | |
| import kafka.consumer.Consumer | |
| import kafka.utils.Utils |
| var Redis = require('redis-stream') | |
| , client = new Redis(6379, 'localhost', process.argv[2] || 0) | |
| , stream = client.stream() | |
| var keys = client.stream('keys') | |
| process.stdin | |
| .pipe(Redis.es.split()) | |
| .pipe(keys) | |
| .pipe(Redis.es.mapSync(function (key) { |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: