Skip to content

Instantly share code, notes, and snippets.

View huyi1985's full-sized avatar

JackalHu huyi1985

View GitHub Profile
@huyi1985
huyi1985 / rbtree.c
Created January 25, 2018 16:13
rbtree from swoole
#ifndef _NGX_RBTREE_H_INCLUDED_
#define _NGX_RBTREE_H_INCLUDED_
#include <stdint.h>
typedef struct swRbtree_node_s swRbtree_node;
struct swRbtree_node_s
{
uint32_t key;
@huyi1985
huyi1985 / [面试]Go面试题.md
Last active July 12, 2023 16:22
[面试]Go面试题

面试题

1. 写出下面代码输出内容。

package main

import (
    "fmt"
)
<?php
$connectTimeout = 0.003;
$timeout = 0.005;
$ip = '';
$port = 0;
$key = 'foo';
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array("sec"=>0, "usec"=> $connectTimeout * 1000000));
@huyi1985
huyi1985 / 0_reuse_code.js
Created June 28, 2016 07:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console