Skip to content

Instantly share code, notes, and snippets.

@wezhang
wezhang / mockHttpService.java
Last active July 26, 2017 02:46
[mock Http service with WireMock] Mock http service with stubfor in wiremock #wiremock
configureFor(mockUri.getHost(), mockedPort);
stubFor(request(action,
urlEqualTo(serviceUrl.substring(mockUri.resolve("/").toString().length() - 1)))
.willReturn(
aResponse()
.withStatus(statusCode)
.withBody(response.replaceAll("\\\\n", "\n"))));
@wezhang
wezhang / patch nerd fonts.cmd
Created July 20, 2017 06:48
[Patch Nerd Fonts] Patch fonts with fontforge in windows
# Run in Administrator
d:\Programs\FontForgeBuilds\bin\fontforge.exe -script font-patcher "c:\windows\fonts\DejaVu Sans Mono for Powerline.ttf" -w -c
curl -XPUT 'http://localhost:9200/us/user/1?pretty=1' -d '
{
"email" : "john@smith.com",
"name" : "John Smith",
"username" : "@john"
}
'
curl -XPUT 'http://localhost:9200/gb/user/2?pretty=1' -d '
{