Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View flxxyz's full-sized avatar
🙏
睡门

一个不知名の睡觉高手 flxxyz

🙏
睡门
View GitHub Profile
@LanfordCai
LanfordCai / solsender.js
Last active April 9, 2024 16:52
Solana Batch Transfer
'use strict'
const web3 = require('@solana/web3.js')
const splToken = require('@solana/spl-token')
const bs = require('bs58')
const connection = new web3.Connection(
web3.clusterApiUrl('devnet'),
'confirmed',
)
@nandorojo
nandorojo / private-npm-in-gh-actions.md
Created August 3, 2021 23:52
Use private NPM packages in your GitHub actions

1 NPM_TOKEN

Add an NPM_TOKEN secret on GitHub. Get your secret key from the NPM dashboard.

2 Add a step to your action

- name: Authenticate with private NPM package
  run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
@ChaseIngebritson
ChaseIngebritson / webpToJimp.js
Last active November 22, 2023 12:33
Convert a .webp image to be readable by Jimp
// This is a temporary fix until Jimp implements support for webp
// https://github.com/oliver-moran/jimp/issues/144
// const img = await webpToJimp('https://test.com/img.webp', './tmp')
import fs from 'fs'
import axios from 'axios'
import jimp from 'jimp'
import webp from 'webp-converter'
@ihipop
ihipop / frp systemd.md
Last active December 26, 2023 05:13
FRP systemd 启动脚本 FRP systemd init config
@ipedrazas
ipedrazas / dump
Created April 22, 2017 04:10
Mongo dump/restore with docker
# Backup DB
docker run \
--rm \
--link running_mongo:mongo \
-v /data/mongo/backup:/backup \
mongo \
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’
# Download the dump
scp -r USER@REMOTE:/data/mongo/backup ./backup
@WesleyBlancoYuan
WesleyBlancoYuan / vhdx2vhd.txt
Created September 6, 2016 07:33
Hyper-V .vhdx 格式磁盘镜像转换为VirtualBox可用的.vhd格式
Hyper-V 默认创建 **.vhdx** 格式的虚拟磁盘。
根据SuperUser上的这个问题:
http://superuser.com/questions/723381/how-to-open-vhdx-files-in-virtualbox
尽管第三个答案指出,
> VirtualBox since 4.2 changelog says support added for VHDX "Storage: added readonly support for VHDX images".
但这种格式在VirtualBox中是不支持的,要使用它建立新的镜像,会出现错误。具体信息为:

video subtitle

ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4

element stream to ts

  • ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts

rtsp 2 rtmp

  • ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit

截图片

@tlikai
tlikai / container.php
Created July 26, 2013 07:33
PHP Dependency Injection Container
<?php
class Container
{
protected $setings = array();
public function set($abstract, $concrete = null)
{
if ($concrete === null) {
$concrete = $abstract;
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");