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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.min.js"></script> | |
</head> | |
<body> | |
<script> | |
const initialState = { |
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 ( | |
"encoding/base64" | |
"fmt" | |
rand "math/rand" | |
"time" | |
"github.com/gin-gonic/gin" |
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
function obj_to_param(obj) { | |
return Object.keys(obj).map(function(key) { | |
return key + '=' + obj[key]; | |
}).join('&'); | |
} | |
function somef(obj) { | |
fetch(`${URL}/api/get/some?${obj_to_param(obj)}`) | |
.then((res) => res.json()) | |
.then((json) => console.log('some: ', json.body)) |
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" | |
"os" | |
"github.com/gin-gonic/contrib/static" | |
"github.com/gin-gonic/gin" | |
) |
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
" You can edit this file by hand. | |
" The " character at the beginning of a line comments out the line. | |
" Blank lines are ignored. | |
" The Default color scheme is used for any directory that does not have | |
" a specified scheme and for parts of user interface like menus. A | |
" color scheme set for a base directory will also | |
" be used for the sub directories. | |
" The standard ncurses colors are: |
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
'use strict'; | |
function merge_arguments() { | |
let obj = {}, | |
i = 0, | |
len = arguments.length, | |
key; | |
for (; i < len; i++) { | |
for (key in arguments[i]) { | |
if (arguments[i].hasOwnProperty(key)) { |
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
// #################### http error {{{ | |
// ApiHttpError something | |
type ApiHttpError struct { | |
Code int `json:"errorCode"` | |
HttpCode int `json:"-"` | |
Message string `json:"errorMsg"` | |
Info string `json:"errorInfo"` | |
} |
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
// ==================== easy error {{{ | |
type EasyAPIError struct { | |
Errors []ErrorDetail `json:"errors"` | |
} | |
// ErrorDetail represents an individual item in an EasyAPIError. | |
type ErrorDetail struct { | |
Message string `json:"message"` | |
Code int `json:"code"` | |
} |
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
#include <stdio.h> | |
#include <pthread.h> | |
void *ping_task(char *arg) | |
{ | |
printf("ping %s", arg); | |
usleep(1); | |
return (NULL); |