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
#!/usr/bin/env node | |
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/ | |
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID | |
// CONFIGURATION ####################################################################################################### | |
const token = '<token>'; // You can learn it from: https://api.slack.com/custom-integrations/legacy-tokens | |
// GLOBALS ############################################################################################################# |
choco install 7zip.install
choco install putty.install
choco install nodejs.install
choco install skype
choco install python2
// timeFormat = 'mm:ss' | |
function convertToSeconds(time) { | |
const [ minutes, seconds ] = time.split(':') | |
const minutesToSeconds = (Number(minutes) * 60) | |
return minutesToSeconds + Number(seconds) | |
} |
const crypto = require('crypto') | |
function encrypt(text) { | |
let key | |
let iv = crypto.randomBytes(16) | |
let hash = crypto.createHash('sha1') | |
hash.update(text) | |
return hash.digest().slice(0, 16).toString('hex') |
const link = document.getElementById('link') | |
const data = { username: 'waghcwb' } | |
const json = JSON.stringify(data, null, 2) | |
const blob = new Blob([json], { type: 'octet/stream' }) | |
const url = window.URL.createObjectURL(blob) | |
link.href = url | |
link.download = 'username.json' |
/** | |
* range() | |
* | |
* Returns an array of numbers between a start number and an end number incremented | |
* sequentially by a fixed number(step), beginning with either the start number or | |
* the end number depending on which is greater. | |
* | |
* @param {number} start (Required: The start number.) | |
* @param {number} end (Required: The end number. If end is less than start, | |
* then the range begins with end instead of start and decrements instead of increment.) |
function getArrayOfDoubles(size = 30, factor = 0.5) { | |
return Array(size).fill(0).map((item, index) => Number((index * factor).toFixed(1))).splice(1) | |
} |
function awaitGlobal(keys, wait = 300) { | |
return Promise.all( | |
[].concat(keys).map(key => { | |
return new Promise((resolve, reject) => { | |
let timer | |
const loop = () => { | |
if (key.indexOf('.') > -1) { | |
try { | |
let __key = key.split('.')[0] | |
if (root[__key]) { |
# runs prettier only in modified files on git | |
git diff --name-only | xargs prettier --config ./prettier.config.js --write |