- https://rubygems.org hosts the Ruby gem for Ruby on Rails.
- The current stable version number of Rails is 5.1.4, with 5.2.0.beta2 being the overall latest version.
- As of this writing, Ruby on Rails has been downloaded 118,011,892 across all versions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stats = Sidekiq::Stats.new | |
stats.queues | |
stats.enqueued | |
stats.processed | |
stats.failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 => '#' | |
} |
NewerOlder