Skip to content

Instantly share code, notes, and snippets.

View huyi1985's full-sized avatar

JackalHu huyi1985

View GitHub Profile
@huyi1985
huyi1985 / populate.py
Created March 5, 2025 08:18
html_dom_max_width(html template and python script to populate data)
# html template file
#
# <style>
# #million_pi {
# width: {max_width}px;
# font-size: 128px;
# }
# </style>
#
# <p id="million_pi">
@huyi1985
huyi1985 / simulate_mario_infinite_background.html
Created March 5, 2025 08:12
simulate_mario_infinite_background.html
<style>
#scrollBox {
/* original size: 1024px * 576px */
width: 2048px;
height: 576px;
overflow: scroll;
background-image: url(./mario_background.png);
background-repeat: repeat-x;
}
</style>
@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