Skip to content

Instantly share code, notes, and snippets.

@xinshangshangxin
xinshangshangxin / hexo3_speed_up
Last active October 22, 2017 18:58
检测md文件,在没有语言说明符的代码段后面加上 类似`js` 的说明符;(Hexo 3 中的 highlight.js 会试图分析 ``` 中的代码内容可能属于哪种语言,内容越长,分析时间就越长)
var fs = require('fs');
var path = require('path');
var userPath = path.resolve(process.argv[2] || './');
var codeStyle = process.argv[3] || 'js';
explorer(userPath);
function explorer(path) {
fs.stat(path, function(err, stat) {
if (err) {
@xinshangshangxin
xinshangshangxin / m3u8-to-mp4.md
Created September 12, 2017 04:05 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@xinshangshangxin
xinshangshangxin / alfred-pinyin.py
Created September 22, 2016 12:04 — forked from tiann/alfred-pinyin.py
make alfred support pinyin search
#! /usr/bin/python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json