Skip to content

Instantly share code, notes, and snippets.

@getadeo
getadeo / ract-dropzone-image.js
Created June 29, 2023 15:26 — forked from schabluk/ract-dropzone-image.js
React-Dropzone get image width, height and base64 data
onDrop = (acceptedFiles, rejectedFiles) => {
const file = acceptedFiles.find(f => f)
const i = new Image()
i.onload = () => {
let reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
console.log({
src: file.preview,
@getadeo
getadeo / sidekiq_monitoring
Created November 26, 2022 07:25 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@getadeo
getadeo / install_ffmpeg_ubuntu.sh
Created January 10, 2020 02:35 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@getadeo
getadeo / rails http status codes
Created September 25, 2019 03:53 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@getadeo
getadeo / 01_ror_tutorial_exercise_answers.md
Created August 5, 2019 02:48
Ruby on Rails Tutorial Exercise Answers

Ruby on Rails Tutorial Exercise Answers

Chapter 1

Section 1.1.1

  1. https://rubygems.org hosts the Ruby gem for Ruby on Rails.
  2. The current stable version number of Rails is 5.1.4, with 5.2.0.beta2 being the overall latest version.
  3. As of this writing, Ruby on Rails has been downloaded 118,011,892 across all versions.
@getadeo
getadeo / README.md
Created May 29, 2018 01:17 — forked from mmailhos/AWS Architect Associate - Reminder.md
AWS Architect Associate - Reminder

AWS Architect Associate - Reminder

EC2

General purpose SSD have a maximum of 10.000 IOPS.

It is possible to detach non-root volume from running EC2 instance.

An EC2 placement group is used to determin how far are instances placed between each other. In cluster mode, they will be placed to reduce the latency inside a single AZ. In spread mode, they will be placed on different underlying hardware (and potentially in different AZ).

call "9263262904", {:callerID => 'sip:21588734@sip.tropo.net'}
ask "Who would you like to call? Just say Joe or John", {
:choices => "Joe, John",
:mode => "speech",
:recognizer => "en-PH",
:minConfidence => 0.6,
:onChoice => lambda { |event| say "You said" + event.value},
:onBadChoice => lambda { |event| say "I'm sorry, I didn't understand what you said."},
:onTimeout => lambda { |event| say "I'm sorry, I didn't hear anything"},
:onHangup => lambda { |event| log "Caller disconnected"}
wait(1500)
say "Starting to test ASR..."
result = ask "Please choose a color from red, blue or green.", {
:choices => "red, blue, green",
:recognizer => "en-PH",
:timeout => 20,
:bargein => true,
:mode => "speech",
:minConfidence => 0.6,
:onChoice => lambda { |event|
call $caller, {:callerID => 'sip:21588260@sip.tropo.net'}
say "Hello"
say "Please wait while we connect your call..."
conference "1337", {
:terminator => "*",
:playTones => true,
:onChoice => lambda { |event|
say("Disconnecting")
}}
say "goodbye"
#call $caller, {:callerID => 'sip:21588260@sip.tropo.net'}
call "9273953465", {:callerID => 'sip:21588260@sip.tropo.net'}
say "Hello! This is to inform you that we have sent a document you requested to the email you gave us. Kindly check your inbox or your spam folder for the message."
result = ask "Were you able to receive the document you requested? Press '1' for YES, or press '2' for NO.", {
:choices => "1,2",
:timeout => 10.0,
:attempts => 3,
:terminator => '#'
}