Skip to content

Instantly share code, notes, and snippets.

@alili
alili / greptime_getting_started.md
Last active September 5, 2023 09:40
greptime_getting_started
@alili
alili / gist:4649422a85204399b2523c8b6c18ea1a
Created November 24, 2021 08:27
B站 弹幕管理 油猴脚本
setTimeout(() => {
let 时间数组 = document.querySelectorAll('td:nth-child(3) .colum-content')
let 链接数组 = document.querySelectorAll('a.danmu-content')
链接数组.forEach((链接, 序号) => {
let [s=0,m=0,h=0] = 时间数组[序号].textContent.split(':').reverse()
链接.href = 链接.href + `?t=${h}h${m}m${s}s`
})
}, 1000)
@alili
alili / get_object_detail.js
Last active November 22, 2016 07:11
get properties and methods of an Object
function fun(name, age){
this.name = name || 'wonderful'
this.age = age || 18
}
fun.prototype.getName = function(){
return this.name
}
var me = new fun()
var ffmpeg = require('fluent-ffmpeg');
var chalk = require('chalk');
var VIDEO_NAME = '01.rmvb'
var timeFormat = function (time,flag) {
var h = Math.floor(time / 3600)
var m = Math.floor(time / 60) % 60
var s = time % 60
function clearString(s){
var pattern = /[`~!@#$^&*()=|{}':;',\\[\\].<>\?~!@#¥……&*()&;|{}【】‘;:”“'。,、?]|\s/;
var rs = "";
for (var i = 0; i < s.length; i++) {
rs = rs+s.substr(i, 1).replace(pattern, '');
}
return rs;
}
@alili
alili / gist:b751db940e501feeaa42
Created November 19, 2015 08:23
判断上传图片像素值
var imageSize = false
var inputElement = document.getElementById("input");
inputElement.addEventListener("change", handleFiles, false);
function handleFiles() {
var fr = new FileReader;
fr.onload = function() { // file is loaded
var img = new Image;
img.onload = function() {