Skip to content

Instantly share code, notes, and snippets.

View nguyentruongtho's full-sized avatar

Tho Neyugn nguyentruongtho

View GitHub Profile
def reverseProxy = Action.async(parse.raw) {
request: Request[RawBuffer] =>
// Create the request to the upstream server:
val proxyRequest =
WS.url("http://localhost:8887" + request.path)
.withFollowRedirects(false)
.withMethod(request.method)
.withVirtualHost("localhost:9000")
.withHeaders(flattenMultiMap(request.headers.toMap): _*)
.withQueryString(request.queryString.mapValues(_.head).toSeq: _*)
// signing.properties
STORE_FILE=../app.jks
STORE_PASSWORD=**pass**
KEY_ALIAS=**key**
KEY_PASSWORD=**pass**
// app.gradle
File propFile = file('signing.properties');
if (propFile.exists()) {
package com.company;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Random;
public class ClassWithNakedConstructorInstantiationBenchMark {
static final int COUNT = 1000000;
static final String CLASS_NAME = HelloWorld.class.getName();
@nguyentruongtho
nguyentruongtho / creditpurge.py
Created May 3, 2014 11:41
Purge all credit signatures which are automatically created by IntelliJ
#!/usr/bin/env python
import os
import re
LIST_SUBMODULE_COMMAND = "awk /path\ =\ / .gitmodules|awk '{print $3}'"
SIGNATURE_INSET = "Created "
SIGNATURE_BEGIN = "/**"
SIGNATURE_END = " */"
/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software