Skip to content

Instantly share code, notes, and snippets.

View danielravina's full-sized avatar
🎯
Focusing

Daniel Ravina danielravina

🎯
Focusing
View GitHub Profile
def upload_stream(file_stream, file_format)
filename = "Report_#{@unit.serial_number}.#{file_format}"
s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])
obj = s3.bucket("flowlink-daily-reports-#{Rails.env}").object(filename)
obj.put(body: file_stream)
end
def upload_file(file_path)
s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])
@danielravina
danielravina / emoji-bot.js
Last active November 29, 2022 16:21
A friendly Slack Bot that responds and reacts to everyone with emojis 🗣
const rp = require('request-promise')
const Botkit = require('botkit');
const emojiDict = require("emoji-dictionary");
const shuffle = require('shuffle-array')
const getRandomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
const controller = Botkit.slackbot();