start new:
tmux
start new with session name:
tmux new -s myname
| import java.util.Optional; | |
| import java.util.function.Consumer; | |
| import java.util.function.Function; | |
| import java.util.function.Supplier; | |
| public abstract class Either<L, R> { | |
| public static final class Left<L, R> extends Either<L, R> { | |
| public Left(L left) { | |
| super(left, null); | |
| } |
| import kotlinx.coroutines.experimental.async | |
| import kotlin.coroutines.experimental.CoroutineContext | |
| suspend fun <T, R> Iterable<T>.pmap(context: CoroutineContext, transform: suspend (T) -> R): List<R> { | |
| return this.map { | |
| async(context) { | |
| transform(it) | |
| } | |
| }.map { it.await() } | |
| } |
| FROM php:5.6-fpm-alpine | |
| RUN apk update && apk add autoconf openssl-dev g++ make && \ | |
| pecl install mongo && \ | |
| docker-php-ext-enable mongo && \ | |
| apk del --purge autoconf openssl-dev g++ make |
| <?php | |
| $ytdlPath = '/whereever/your/youtube-dl'; //change this | |
| ob_start(); | |
| $url = trim(rawurldecode($_SERVER['QUERY_STRING'])); | |
| $qStr = parse_url($url, PHP_URL_QUERY ); | |
| parse_str($qStr, $get); | |
| if (!isset($get['v']) || !preg_match('~[a-zA-Z0-9_-]{11}~',$get['v']) ) { |
| #!/bin/bash | |
| # | |
| # Generates client and server certificates used to enable HTTPS | |
| # remote authentication to a Docker daemon. | |
| # | |
| # See http://docs.docker.com/articles/https/ | |
| # | |
| # To start the Docker Daemon: | |
| # | |
| # sudo docker -d \ |
| http { | |
| log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent" $request_time ' | |
| '<"$request_body" >"$resp_body"'; | |
| lua_need_request_body on; | |
| set $resp_body ""; | |
| body_filter_by_lua ' |
| import java.lang.annotation.Annotation; | |
| import java.util.List; | |
| import java.util.Map; | |
| import org.springframework.beans.factory.config.BeanDefinition; | |
| import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.ConfigurableApplicationContext; | |
| import org.springframework.core.type.StandardMethodMetadata; | |
| import com.google.common.base.Preconditions; | |
| import com.google.common.base.Predicate; |
| MongoTemplate mongo = ...; | |
| List<Converter> converters = new ArrayList<Converter>(); | |
| converters.add(new Converter<DBObject, Participant>() { | |
| public Participant convert(DBObject s) { | |
| throw new UnsupportedOperationException("Not supported yet 1."); | |
| } | |
| }); | |
| converters.add(new Converter<Participant, DBObject>() { |