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 / go_file_print.go
Created May 26, 2016 02:35
golang print file content
//打印文件内容
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"io"
"path/filepath"
@limboinf
limboinf / app.js
Created August 17, 2016 08:27
《Nodejs实战》TOP3继承并扩展EventEmitter事件处理文件监听
var Watch = require('./fswatch'),
fs = require('fs'),
watchDir = './watch',
processDir = './done';
var watcher = new Watch(watchDir, processDir);
watcher.on('process', function (file) {
var watchFile = this.watchDir + '/' + file;
@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 / tornado-async-spider.py
Last active June 12, 2018 08:21
tornado异步爬虫示例
# coding=utf-8
"""
tornado异步爬虫示例
"""
import time
from datetime import timedelta
from bs4 import BeautifulSoup
from tornado.httpclient import AsyncHTTPClient
from tornado import ioloop, gen, queues
@limboinf
limboinf / __init__.py
Created February 8, 2017 09:10
Api Key + Security Key + Sign.
# coding=utf-8
"""
desc..
:copyright: (c) 2016 by fangpeng(@beginman.cn).
:license: MIT, see LICENSE for more details.
"""
import hmac
import hashlib
import base64
import redis
@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"
)