Beego https://github.com/astaxie/beego : 7607
Gin https://github.com/gin-gonic/gin : 7153
Revel https://github.com/revel/revel : 7051
Echo https://github.com/labstack/echo : 4956
go-kit https://github.com/go-kit/kit : 4813
Iris https://github.com/kataras/iris : 4451
httprouter https://github.com/julienschmidt/httprouter : 3408
mux https://github.com/gorilla/mux : 2581
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
typedef enum { false, | |
true } bool; | |
bool IsBigEndian() | |
{ | |
int a = 0x1234; | |
char b = *(char *)&a; //通过将int强制类型转换成char单字节,通过判断起始存储位置。即等于 取b等于a的低地址部分 | |
if (b == 0x12) | |
{ | |
return true; |
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
#[macro_use] | |
extern crate comp; | |
fn main() { | |
println!("Hello, world!"); | |
let iter = iter! { | |
let x <- 0..2u8; | |
let y <- vec!['a', 'b']; | |
(x, y) | |
}; |
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
alias cargo-fmt="cargo fmt -- --write-mode=overwrite -v" |
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
mix_dep {:httpotion, "~> 3.0.2"} | |
ret = HTTPotion.get "https://static.ifood360.com/03ce19e7a2da4f0f87bc872fc77f5e84.jpg?iopcmd=thumbnail&type=13&width=400&height=300" | |
:crypto.md5(ret.body) |> Base.encode16(case: :lower) |> IO.puts |
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
val stringStream = Stream.of(*(1..10).toList().map(Int::toString).toTypedArray()) | |
stringStream.parallel().map { | |
"thread ${Thread.currentThread()}: $it" | |
}.forEach(::println) |
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
#!/bin/bash | |
port=$1 | |
if [ "$port" = "" ]; then | |
echo "please input the port for check!" | |
exit 1 | |
fi | |
max_attempts=10 |
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 demo | |
import java.security.SecureRandom | |
import java.util.* | |
import javax.crypto.KeyGenerator | |
fun main(args: Array<String>) { | |
val kgs = listOf(KeyGenerator.getInstance("AES").apply { init(SecureRandom()) }, | |
KeyGenerator.getInstance("AES").apply { init(128) }) |
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 ( | |
"fmt" | |
//"github.com/shezadkhan137/go-qrcode/qrcode" | |
"encoding/base64" | |
"io/ioutil" | |
"strings" |
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
interface Nameable { | |
String getName(); | |
} | |
public class Test { | |
public static void main(String[] args) { | |
Nameable nameable1 = "String"::toString; | |
hello(nameable1); |