Skip to content

Instantly share code, notes, and snippets.

@maruware
maruware / install-ffmpeg-amazon-linux.sh
Last active April 25, 2016 12:53 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@maruware
maruware / convert.ts
Last active January 19, 2022 01:28 — forked from wuchengwei/dataURL to blob and blob to dataURL
dataURL to blob and blob to dataURL
//**dataURL to blob**
function dataURLtoBlob(dataurl: string) {
const arr = dataurl.split(',')
const fmt = arr[0]
const b64 = arr[1]
if (!fmt || !b64) throw new Error('invalid dataurl')
const m = fmt.match(/:(.*?);/)
if (!m) throw new Error('invalid dataurl')