Skip to content

Instantly share code, notes, and snippets.

View limboinf's full-sized avatar
🎯
Focusing

limbo limboinf

🎯
Focusing
View GitHub Profile
// #popclip extension for ChatGPT
// name: LimboGPT
// icon: iconify:logos:openai-icon
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
@limboinf
limboinf / youtube_download.py
Created June 7, 2023 16:22
yt-dlp 快速下载YouTube视频
import os
import subprocess
import multiprocessing
from colorama import Fore, Back, Style
def download_url(url):
flag = f'PID: {os.getpid()} --> 下载: {url}'
// group by traceId, event fields and get the max item.
void testIt() {
List<Event> events = new ArrayList<>();
events.add(new Event("AAA", "ROOM_START", 1000L, 10));
events.add(new Event("AAA", "ROOM_START", 1000L, 10));
events.add(new Event("BBB", "ROOM_START", 1002L, 15));
events.add(new Event("BBB", "ROOM_START", 1001L, 10));
// method1
Map<String, Map<String, List<Event>>> collect = events.stream()
@limboinf
limboinf / readme.md
Last active December 6, 2018 09:44
[linux tips]

在linux中,- 如果单独使用 - 符号,不加任何该加的文件名称时,代表"标准输入"的意思

如下小技巧,nc命令来传输目录下多个文件

# host A, on receiver, go to destination directory and execute:
$ nc -l $port | tar xf -

# host B,on sender
@limboinf
limboinf / ddata.go
Created December 18, 2017 07:22
Implement Read like Reader interface, you can get inspiration from buffer.go
package main
import (
"io"
"fmt"
)
type Data struct {
stream string
@limboinf
limboinf / gtopic.go
Created December 17, 2017 10:14
Get the latest topics of studygolang.com
package main
import (
"log"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/briandowns/spinner"
)
@limboinf
limboinf / signal.go
Created October 16, 2017 09:08
[go signal] #go
package main
import (
"fmt"
"time"
"os"
"os/signal"
"syscall"
)
@limboinf
limboinf / access.lua
Created September 30, 2017 03:31 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@limboinf
limboinf / Dockerfile
Last active September 29, 2017 08:05
[Docker Ng Lua With China APT Source] #docekr #ng #lua
# Version 0.0.1
FROM ubuntu:14.04
MAINTAINER Beginman "xinxinyu2011@163.com"
ARG CHAINA_APT_SOURCE
RUN /bin/bash -c "if [[ ${CHAINA_APT_SOURCE} == ON ]];then sed -i 's#http://archive.ubuntu.com#http://mirrors.163.com#g' /etc/apt/sources.list; fi"
RUN apt-get update
RUN apt-get install -y lua5.1
RUN apt-get install -y liblua5.1-dev
RUN apt-get install -y git
RUN apt-get install -y nginx
@limboinf
limboinf / Main.java
Created September 28, 2017 15:05
[Java File read] #java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Main {
/**
* 步骤:
* 1. File 创建文件句柄