This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -v 'http://zsh.com/js/zepto.se.js' | |
* Trying 121.40.217.132... | |
* TCP_NODELAY set | |
* Connected to zsh.com (121.40.217.132) port 80 (#0) | |
> GET /js/zepto.se.js HTTP/1.1 | |
> Host: zsh.com | |
> User-Agent: curl/7.56.0 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oxerr.sandbox; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLDecoder; | |
import java.net.URLEncoder; | |
import java.nio.charset.StandardCharsets; | |
public class URLEncode { | |
public static void main(String[] args) throws UnsupportedEncodingException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
private Main m = new Main(); | |
public static void main(String[] args) { | |
new Main(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isValid(String param) { | |
return param != null && (param.equals("0") || param.equals("1")); | |
} | |
private boolean isValid(String... params) { | |
for (String param : params) { | |
if (!isValid(param)) { | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String makeToJsonStr(String str) { | |
var keys = "label|fieldType|searchType|editHide|addHide|hide|disabled|required|comment|options"; | |
var regex = "(?<key>" + keys + ")\\s*:(?<value>(?:(?!(" + keys + "):).)*)(?<delimiter>[\\,\\}])"; | |
var replacement = "\"${key}\":\"${value}\"${delimiter}"; | |
var replaced = str.replaceAll(regex, replacement); | |
return replaced; | |
} |