Checkout the blog post for the whole story.
Setup Bower and install components:
npm install -g bower
bower install
Before deploying to Heroku, switch to the multi buildpack:
Checkout the blog post for the whole story.
Setup Bower and install components:
npm install -g bower
bower install
Before deploying to Heroku, switch to the multi buildpack:
// Create a Promise that resolves after ms time | |
var timer = function(ms) { | |
return new Promise(resolve => { | |
setTimeout(resolve, ms); | |
}); | |
}; | |
// Repeatedly generate a number starting | |
// from 0 after a random amount of time | |
var source = async function*() { |
var graph = [ | |
'AB6', | |
'AC3', | |
'BD6', | |
'CD5', | |
'CE9', | |
'DF8', | |
'DE3', | |
'EG8', | |
'FG2' |
let timer = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
let producer = async function*() { | |
let counter = 0; | |
while (true) { | |
let delay = Math.random() * 1000; | |
await timer(delay); | |
yield counter++; | |
} | |
}; |
const intRegex = /^(0|[1-9]\d*)$/; | |
let isIndex = prop => | |
typeof prop === 'string' | |
&& intRegex.test(prop); | |
let concat = (left, right) => { | |
let w = left.length; | |
let h = right.length; |
#!/usr/bin/env bash | |
# ~/.macos — https://mths.be/macos | |
# Close any open System Preferences panes, to prevent them from overriding | |
# settings we’re about to change | |
osascript -e 'tell application "System Preferences" to quit' | |
# Ask for the administrator password upfront | |
sudo -v |
import processImage from 'process-image'; | |
var file = /* File() object from drag-n-drop or file input */ | |
var imageProcessOpts = { | |
maxWidth: 1200, | |
maxHeight: 1200, | |
quality: 0.6 | |
}; |
function getCost(cell) { | |
return cell.match(/\$[\d.,]+\d/)[0] | |
} | |
function getCondition(cell) { | |
return cell.match(/((like )?new|used|mint|good|great|excellent)/i)[0] | |
} | |
function getEmail(cell) { | |
return (cell.match(/[^\s@]+@[^\s@]+/i) || ['N/A'])[0] |
const SlackBot = require('slackbots'); | |
const BOT_NAME = 'Slacks or Shorts'; | |
const BOT_TOKEN = '<YOUR-TOKEN-HERE>'; | |
const BOT_HANDLE = 'slacks-or-shorts'; | |
let bot = new SlackBot({ | |
token: BOT_TOKEN, | |
name: BOT_NAME | |
}); |