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
// pending | |
// fulfilled | |
// rejected | |
class MyPromise { | |
constructor(executor) { | |
this.$state = "pending" | |
this.$res = null | |
this.$chain = [] |
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
const chars = [ | |
"富强", | |
"民主", | |
"文明", | |
"和谐", | |
"爱国", | |
"敬业", | |
"诚信", | |
"友善", | |
"自由", |
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 Mue(opts) { | |
opts.data = opts.data || {} | |
opts.computed = opts.computed || {} | |
opts.watch = opts.watch || {} | |
const self = this | |
const watchers = {} | |
function observe(key, fn) { |
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
#include <stdio.h> | |
#include <netinet/in.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#define PORT 8080 | |
#define SA struct sockaddr | |
int main() | |
{ | |
int sockfd, connfd, len; |
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 main | |
import ( | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"strings" | |
) |