Skip to content

Instantly share code, notes, and snippets.

View songtianlun's full-sized avatar
🎯
Focusing

TianLun Song songtianlun

🎯
Focusing
View GitHub Profile
// ==WidgetScript==
// @name 🐼 本期支出
// @description 从 Notion 数据库中统计支出情况
// @icon system:chart.bar.xaxis
// @iconBgColor #04B921
// @param api {string="https://api.imalan.cn/notion_bkp/stat"} API - URL to your metrics data API
// @param token_v2 {string=""} Notion token - 先浏览器登录 Notion,cookie 中名为 token_v2 的字段
// @param db_url {string=""} Database 链接
// @param total_b {string=""} 总支出预算
@flxxyz
flxxyz / GetSystemVersionNumber.go
Last active April 9, 2023 05:50
obtain the system version number(windows, linux, darwin or macos)
// golang 获取系统版本号 (windows, linux, darwin or macos)
// golang obtain the system version number (windows, linux, darwin or macos)
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
@imba-tjd
imba-tjd / .Cloud.md
Last active May 5, 2024 13:48
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@bamoo456
bamoo456 / main.go
Last active August 8, 2023 07:41
[Golang] execute long running job and streaming the realtime output
func main() {
cmd := exec.Command("sh", "-c", "cd ../../bin/worker; ./run.sh")
// some command output will be input into stderr
// e.g.
// cmd := exec.Command("../../bin/master_build")
// stderr, err := cmd.StderrPipe()
stdout, err := cmd.StdoutPipe()
if err != nil {
fmt.Println(err)
}
@gonzaloserrano
gonzaloserrano / log.go
Created August 18, 2015 17:56
logrus wrapper
package log
import (
"fmt"
"github.com/Sirupsen/logrus"
"runtime"
"strings"
)
var logger = logrus.New()
@damphat
damphat / apt-rdepends-tree
Last active December 16, 2023 01:38
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi