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
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"; |
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
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" + |
# Initialize a git repository
$ mkdir git-history
$ cd git-history
$ git init
# Add three commit records
$ touch a.txt
$ git add .
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
function toRawType (value) { | |
let _toString = Object.prototype.toString; | |
return _toString.call(value).slice(8, -1) | |
} |
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
function toRawType (value) { | |
let _toString = Object.prototype.toString; | |
let str = _toString.call(value) | |
return str.slice(8, -1) | |
} |
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
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); |