Skip to content

Instantly share code, notes, and snippets.

View abserari's full-sized avatar
🐱
Let's build a better world

DingRui Yang abserari

🐱
Let's build a better world
View GitHub Profile
@abserari
abserari / list.c
Created November 16, 2020 04:47
how list head could find the nesting structure
#include <stdio.h>
#include <stddef.h>
typedef struct List {
struct List *next;
struct List *prev;
} List;
typedef struct devices {
int first;
@abserari
abserari / MySQL.go
Last active January 11, 2021 13:47
Pub/Sub Pattern realized by SQL database;
package main
import (
"bytes"
stdSQL "database/sql"
"encoding/gob"
"fmt"
"strings"
"time"
@abserari
abserari / docker-compose.yaml
Created January 11, 2021 13:48
这里是我收集的 docker-compose 写法
version: '3'
services:
server:
image: golang:1.12
restart: unless-stopped
depends_on:
- mysql
- postgres
volumes:
- .:/app
@abserari
abserari / README-badges.md
Created January 12, 2021 04:17 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@abserari
abserari / ssh.go
Last active January 18, 2021 10:18
quickly ssh transport
package sshproxy
import (
"bytes"
"encoding/binary"
"fmt"
"golang.org/x/crypto/ssh"
"io"
"io/ioutil"
"log"
@abserari
abserari / maxopenfile.go
Created January 18, 2021 09:55
Update system limit about file number.
package maxopenfile
import (
"log"
"syscall"
)
func MaxOpenFiles() {
var rLimit syscall.Rlimit
@abserari
abserari / visitor.go
Created March 12, 2021 00:33
visitor model
package visitor
import (
"context"
"errors"
"github.com/silverswords/pulse/pkg/message/retry"
"github.com/silverswords/pulse/pkg/message/timingwheel"
"log"
"time"
)
@abserari
abserari / README.md
Created March 16, 2021 15:04
how the texas poker win or not
@abserari
abserari / drag_and_drop.dart
Created May 10, 2021 15:30
Drag to Generate Flutter UI
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@abserari
abserari / map-equal.go
Created March 9, 2022 03:21
golang map equal
func equal(x, y map[string]int) bool {
if len(x) != len(y) {
return false
}
for k, xv := range x {
if yv, ok := y[k]; !ok || yv != xv {
return false
}
}
return true