ffmpeg -i "input.MP4" -vb xxxk -vcodec libx264 -ab 64k -ar 44100 -y "output_.MP4"
xxxk
: You should adjust its size according to your needs.
For example i use 2000k to compress Gopro mp4 videos.
package main | |
import ( | |
"bufio" | |
"crypto/md5" | |
"crypto/sha1" | |
"crypto/sha256" | |
"crypto/sha512" | |
"encoding/hex" | |
"fmt" |
/** | |
* @author Dongxu Huang, Shu Ke, Wang Lei | |
* @date 2013-07-08 | |
*/ | |
document.addEventListener("mousemove", update_mouse_pos, true); | |
document.addEventListener("mouseup", on_mouse_up, true); | |
document.addEventListener("mousedown", on_mouse_down, true); | |
document.addEventListener("dblclick", on_mouse_dbclick, true); | |
var clientX, clientY; |
MD5 checksum | |
In order to find the MD5 checksum value of a file using the following command in the terminal. | |
$ md5 /path/to/file | |
To find the SHA1 checksum value use the following command in the terminal. | |
$ shasum -a 1 /path/to/file | |
To find the SHA256 checksum use the following command in the terminal. | |
$ shasum -a 256 /path/to/file |
FROM alpine:3.4 | |
ENV TZ 'Asia/Shanghai' | |
RUN apk upgrade --no-cache && \ | |
apk add --no-cache bash tzdata && \ | |
mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && \ | |
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | |
echo "Asia/Shanghai" > /etc/timezone && \ |
#!/bin/sh | |
version="0.1.0" | |
UNAME=$(uname) | |
# Check to see if it starts with MINGW. | |
if [ "$UNAME" ">" "MINGW" -a "$UNAME" "<" "MINGX" ] ; then | |
echo "current release do not support windows" | |
exit 1 |
// https://cnodejs.org/topic/516e0ab46d382773067a5473 | |
var http = require('http'); | |
var url = require('url'); | |
var Iconv = require('iconv').Iconv; | |
var crypto = require('crypto'); | |
var server = http.createServer(function(req, res){ | |
var path = url.parse(req.url).pathname; | |
if(path == '/favicon.ico'){ | |
res.end(''); |
// from here: http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/ | |
// great example !! | |
func payloadHandler(w http.ResponseWriter, r *http.Request) { | |
if r.Method != "POST" { | |
w.WriteHeader(http.StatusMethodNotAllowed) | |
return | |
} | |
// Read the body into a string for json decoding |
'use strict'; | |
const fs = require('fs'); | |
const iconv = require('iconv-lite'); | |
const path = require('path'); | |
const p = console.log; | |
function readText(path) { | |
let buf = fs.readFileSync(path); | |
return iconv.decode(buf, 'gbk'); |
function customRouter(originRouter, prefix) { | |
let urlArr = []; | |
let slice = [].slice; | |
let methods = ['get', 'post', 'delete', 'put']; | |
function array2ArrayLike(array) { | |
let arrayLike = { | |
length: 0 | |
} | |
for(let i = 0; i < array.length; i++) { |