Skip to content

Instantly share code, notes, and snippets.

View hengfeiyang's full-sized avatar

Hengfei Yang hengfeiyang

View GitHub Profile
@hengfeiyang
hengfeiyang / data_table.rs
Created October 8, 2023 03:42
data_table
use rand::Rng;
use std::{f64::consts::PI, time::Instant};
const N: usize = 1_000_000;
const N_WARMUP: usize = 100;
#[derive(Copy, Clone)]
enum ShapeType {
Square,
Rectangle,
@hengfeiyang
hengfeiyang / crawl.go
Created September 23, 2016 13:40
use go crawl website urls
package main
import (
"fmt"
"net/url"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
@hengfeiyang
hengfeiyang / golang-tls.md
Created July 10, 2016 03:42 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@hengfeiyang
hengfeiyang / algorithms.go
Created November 16, 2015 07:34
八大排序算法的 Go 实现 和 效率测试
package main
import (
"fmt"
"math"
"math/rand"
"reflect"
"sort"
"time"
)
@hengfeiyang
hengfeiyang / algorithms.php
Last active July 8, 2021 04:55
八大排序算法的 PHP 实现 和 效率测试
<?php
$num = 1000;
$times = 3;
$algorithms = array('insert', 'shell', 'bubble', 'quick', 'select', 'heap', 'merge', 'radix');
$arr = array();
while (count($arr) < $num) {
$key = rand(1, $num * 10);
$arr[$key] = 1;