Skip to content

Instantly share code, notes, and snippets.

View linkerlin's full-sized avatar
🎯
Focusing

Halo Master linkerlin

🎯
Focusing
View GitHub Profile
@linkerlin
linkerlin / bytetrie.go
Last active March 25, 2018 17:41
High Speed Byte Trie
package flashtext
type bytetrie struct {
key byte
next [256]*bytetrie
word string
}
func NewByteTrie(b byte) *bytetrie {
return &bytetrie{
@linkerlin
linkerlin / 许诺.js
Created October 25, 2018 05:19
关于Promise的例子
function 获取网络资源(网址) {
return new Promise((解决, 拒绝)=> {
var 请求 = new XMLHttpRequest();
请求.open('GET', 网址, true);
请求.onload = 括弧=> {
if (请求.status === 200) {
解决(请求.responseText);
} else {
拒绝(new Error(请求.statusText));
}
@linkerlin
linkerlin / 许诺.js
Created October 25, 2018 05:19
关于Promise的例子
function 获取网络资源(网址) {
return new Promise((解决, 拒绝)=> {
var 请求 = new XMLHttpRequest();
请求.open('GET', 网址, true);
请求.onload = 括弧=> {
if (请求.status === 200) {
解决(请求.responseText);
} else {
拒绝(new Error(请求.statusText));
}
@linkerlin
linkerlin / mmap_demo.go
Created January 24, 2018 15:45
A demo of mmap for Go
package main
import (
"bytes"
"encoding/binary"
"os"
"sync"
"fmt"
"math/rand"
"path/filepath"
@linkerlin
linkerlin / .ipynb
Created September 10, 2022 04:23
封神榜大模型.ipynb
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"collapsed_sections": [],
"machine_shape": "hm",
"authorship_tag": "ABX9TyMK+iTIWvrDxWHWBIXKg3Xw",
"include_colab_link": true
@linkerlin
linkerlin / jina-ai.ipynb
Created September 9, 2022 23:56
jina-ai.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@linkerlin
linkerlin / test_einops.ipynb
Last active September 18, 2022 13:28
einops爱因斯坦表达式使用教程.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.