This file contains hidden or 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
| const axios = { | |
| get(url, { headers = {} }) { | |
| return new Promise((resolve, reject) => { | |
| const xhr = window.XMLHttpRequest | |
| ? new XMLHttpRequest() | |
| : new ActiveXObject("Microsoft.XMLHTTP"); | |
| xhr.open("get", url); | |
| xhr.withCredentials = true; | |
| // Object.entries(headers).forEach(([key,value]) => xhr.setRequestHeader(key, value)); |
This file contains hidden or 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
| // A blockchain is a distributed database for an append-only sequence of records. | |
| It works like a log: new records are appended over time and linked together, | |
| similar to a linked list. | |
| Class DataBlock { | |
| getData(); | |
| setData(); | |
| getPre(); | |
| getNext(); |
This file contains hidden or 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 main | |
| import "fmt" | |
| func main() { | |
| fmt.Println("Hello, World!") | |
| } |
This file contains hidden or 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 main | |
| import ( | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "encoding/json" | |
| "io" | |
| "log" | |
| "net/http" | |
| "os" |