Skip to content

Instantly share code, notes, and snippets.

@asins
asins / git.rs
Created July 25, 2024 12:47
使用git2-rs库克隆指定的单个分支的内容
use git2::build::RepoBuilder;
use git2::{Cred, FetchOptions, RemoteCallbacks};
use std::path::{Path, PathBuf};
#[derive(Debug)]
pub struct SshKey {
pub public_key: PathBuf,
pub private_key: PathBuf,
}
@asins
asins / main.js
Last active April 17, 2019 16:33
通过ffmpeg对m4a文件设置meta信息
const fs = require('fs');
const path = require('path');
const { spawn } = require( 'child_process' );
const sourcePath = path.resolve('./video/');
const distPath = path.resolve('./new/');
const ALBUM = '我修的可能是假仙';
const AUTHOR = '牛大宝';
let videoFileList;
@asins
asins / IE getter setter
Last active February 25, 2019 14:32
IE中getter/setter 的实现
<!DOCTYPE html>
<html>
<head>
<title>A Crazy Getter/Setter Hack</title>
</head>
<body>
<ul>
<li>Object.defineProperty API:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty</li>
<li>https://github.com/RubyLouvre/avalon/blob/master/avalon.shim.js#L1394</li>
<li>https://gist.github.com/jeffrafter/189354</li>