Skip to content

Instantly share code, notes, and snippets.

View bitfishxyz's full-sized avatar
🐥
🐔🐔🥚🥚

medium003 bitfishxyz

🐥
🐔🐔🥚🥚
View GitHub Profile
@bitfishxyz
bitfishxyz / httpRequest.java
Created March 26, 2019 02:44
Send a http request in Java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
public class Request {
public static void main(String[] args) throws Exception{
String baseURL = "https://api.github.com";
@bitfishxyz
bitfishxyz / ParseQueryString.java
Created March 26, 2019 02:46
Parse QueryString in Java with apache URLEncodedUtils
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import java.net.URI;
import java.util.List;
public class B {
public static void main(String[] args) throws Exception {
String url = "http://www.example.com/something.html" +
We couldn’t find that file to show.
We couldn’t find that file to show.
# Initialize a git repository
$ mkdir git-history
$ cd git-history
$ git init

# Add three commit records

$ touch a.txt
$ git add .
We couldn’t find that file to show.
function toRawType (value) {
let _toString = Object.prototype.toString;
return _toString.call(value).slice(8, -1)
}
function toRawType (value) {
let _toString = Object.prototype.toString;
let str = _toString.call(value)
return str.slice(8, -1)
}
function cached(fn){
// Create an object to store the results returned after each function execution.
const cache = Object.create(null);
// Returns the wrapped function
return function cachedFn (str) {
// If the cache is not hit, the function will be executed
if ( !cache[str] ) {
let result = fn(str);