Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
const nodeRSA = require('node-rsa'); | |
const fetch = require('node-fetch'); | |
const publicKey = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbM2br48JS2JJy8Ajy0gy33Gu5RNAFgysUp4Mj9FqzXWg7AwdGaXc0vIAGG3vmyrP906qJpiEV1aW9GhsEGNQ9Mjmngfnu1VAKZjskVToqG1ktiXZJKSlVUfGTYj+r1lKDgd2iKt4azIzoeElk1gnLovn8zEaiCT7prHlzWWb7JgW3qp1e12e5WvSC5xX9P5iKOs6WM3qTSAX3e8qGeA9wtlHdQuDjSjWA0WlYQIFKgpoCBNZeldNxel79QgR7QKG6Oo/H4aImhDW9vXH00mGVy9QX11ngovVYPhCQWzsAo+v+Y2lAJUtFdjr2t9/mJisKxpYvpMeqVo2ZSydwBmb5' | |
const consumerId = 'change this to your consumer id' | |
const privateKey = "MIIEpAIBAAKCAQEAmzNm6+PCUtiScvAI8tIMt9xruUTQBYMrFKeDI/Ras11oOwMH\ | |
Rml3NLyABht75sqz/dOqiaYhFdWlvRobBBjUPTI5p4H57tVQCmY7JFU6KhtZLYl2\ | |
SSkpVVHxk2I/q9ZSg4HdoireGsyM6HhJZNYJy6L5/MxGogk+6ax5c1lm+yYFt6qd\ | |
XtdnuVr0gucV/T+YijrOljN6k0gF93vKhngPcLZR3ULg40o1gNFpWECBSoKaAgTW\ | |
XpXTcXpe/UIEe0ChujqPx+GiJoQ1vb1x9NJhlcvUF9dZ4KL1WD4QkFs7AKPr/mNp\ |
make_wm_request: async function({method,url,http_body,vendor_id,consumer_id,consumer_pk,channel_type} = {}){ | |
return new Promise(async function(resolve,reject){ | |
//if you don't have a PEM-formatted private key (we didn't), generate one real quick | |
var pk_chunked = chunkSubstr(consumer_pk, 64).join("\n") | |
pk_chunked = "-----BEGIN PRIVATE KEY-----\n" + pk_chunked + "\n-----END PRIVATE KEY-----\n" | |
var epoch_timestamp = Date.now() |
// when you're trying to use `position:sticky` on an element | |
// you'll have trouble if any parent/ancestor element has | |
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll) | |
// & turns out if a parent is `display:flex` it might need some love | |
// (to remedy this you can set the `align-self` of your sticky element) | |
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o | |
// so, to find those troublesome parents... | |
// copy & paste this into Chrome Inspector/Dev Tools console | |
// (and be sure to change the #stickyElement below, if needed) |
/*Please do support www.bitshiftprogrammer.com by joining the facebook page : fb.com/BitshiftProgrammer | |
Legal Stuff: | |
This code is free to use no restrictions but attribution would be appreciated. | |
Any damage caused either partly or completly due to usage this stuff is not my responsibility*/ | |
Shader "BitshiftProgrammer/Billboard" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture Image", 2D) = "white" {} | |
_Scaling("Scaling", Float) = 1.0 |
const fs = require('fs'); | |
const jwt = require('jsonwebtoken'); | |
// http://travistidwell.com/blog/2013/09/06/an-online-rsa-public-and-private-key-generator/ | |
// use 'utf8' to get string instead of byte array (1024 bit key) | |
var privateKEY = fs.readFileSync('./private.key', 'utf8'); // to sign JWT | |
var publicKEY = fs.readFileSync('./public.key', 'utf8'); // to verify JWT | |
module.exports = { | |
sign: (payload, $Options) => { | |
/* |
/* | |
Usage (I however think that the code is self explanatory) | |
<ReactComment text={` | |
Very long comment with html link | |
<a href="https://gist.github.com/alexeychikk/bfe72a072a9a962f2da900b6151e4aae">Star me :)</a> | |
`} /> | |
*/ | |
import React, {Component, PropTypes} from 'react'; |
{ | |
"red": { | |
"50": "#ffebee", | |
"100": "#ffcdd2", | |
"200": "#ef9a9a", | |
"300": "#e57373", | |
"400": "#ef5350", | |
"500": "#f44336", | |
"600": "#e53935", | |
"700": "#d32f2f", |
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |