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 / 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 / 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 / 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 / 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 / bytesconv.go
Created November 12, 2020 13:50
Zero-Copy, Fast Convert.
// Copyright 2020 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package bytesconv
import (
"reflect"
"unsafe"
)
func echo(wq *waiter.Queue, ep tcpip.Endpoint) {
defer ep.Close()
// Create wait queue entry that notifies a channel.
waitEntry, notifyCh := waiter.NewChannelEntry(nil)
wq.EventRegister(&waitEntry, waiter.EventIn)
defer wq.EventUnregister(&waitEntry)
for {
@abserari
abserari / replication.go
Created September 8, 2020 02:36
minio set bucket replication
package main
import (
"encoding/xml"
"github.com/minio/minio-go/v7/pkg/replication"
"github.com/silverswords/muses.minio/bucketStorage"
"log"
)
func main() {
@abserari
abserari / scheduler.go
Created August 30, 2020 07:04
golang schduler by google pubsub
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@abserari
abserari / nginx.conf
Created October 12, 2019 15:15
use for nginx proxy my jupyterLab service on my server.
server
{
listen 80;
server_name jupyter.abser.top;
chunked_transfer_encoding on;
location / {
proxy_pass http://127.0.0.1:8888;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
FROM ubuntu:16.04
# system basics
RUN apt-get update && \
apt-get -y --no-install-recommends install \
build-essential \
curl \
python3 \
python3-dev \
python3-setuptools \