- AppSignal: Improve performance, debug errors and track deploys for your Ruby on Rails apps
- Honeybadger: Modern error management and performance monitoring for web applications
- Informant: Usability monitoring for Ruby on Rails.
- Raygun: Real time error reporting you can set up in under 5 minutes!
- Keen IO: Analytics for Developers
- DbInsights: Business intelligence insights and analytics from your database
- IronWorker: Highly available and scalable task queue / worker service.
- Free version seems only suitable for very small scale tasks. Better to use Que if scheduled size expected to exceed 5.
- QuotaGuard: Proxy Your API
This file contains hidden or 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
Connection String | |
mysql://USERNAME:PASSWORD@HOST/DATABASE | |
Command line where FILENAME is file with data to be imported (filename.sql). | |
mysql -u USERNAME -pPASSWORD -h HOST DATABASE < FILENAME > import.log |
This file contains hidden or 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
# Good solution for exporting to CSV in rails. | |
# Source: https://www.codementor.io/victorhazbun/export-records-to-csv-files-ruby-on-rails-vda8323q0 | |
class UsersController < ApplicationController | |
def index | |
@users = User.all | |
respond_to do |format| | |
format.html | |
format.csv { send_data @users.to_csv, filename: "users-#{Date.today}.csv" } |
This file contains hidden or 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
... | |
gem 'kaminari' | |
gem 'ransack' | |
.. |
This file contains hidden or 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
<%= form_tag(form_path, remote: true, id: "this-form", | |
class: "form form-inline col-md-12", | |
onchange: "$('#this-form').submit();") do |f| %> | |
... | |
<%= check_box_tag ... %> | |
<%= radio_button_tag ... %> | |
... | |
<% end %> |
This file contains hidden or 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
# app/jobs/cron_job.rb | |
class CronJob < Que::Job | |
# To minimize log clutter from unavailable jobs, | |
# @run_at should be a bit less than Que.wake_interval | |
@run_at = proc { 59.seconds.from_now } | |
def run | |
# Do stuff here | |
This file contains hidden or 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
// The below must be included somewhere in in .js.erb file. | |
... | |
$('#bootstrap-flash').html("<%= j (bootstrap_flash) %>"); | |
... |
This file contains hidden or 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
<div id="demo"></div> | |
<button onclick="getLocation()">Click to show location</button> | |
<script> | |
var x = document.getElementById("demo"); | |
function getLocation() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(showPosition); | |
} else { |
This file contains hidden or 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
Rubocop: | |
#Parameters: '-D -E --auto-gen-config --auto-correct' | |
Parameters: '-D -E --auto-gen-config' | |
Breakman: | |
Parameters: '-A -q --summary' | |
Cane: | |
Parameters: '' |
This file contains hidden or 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
<table class="table table-hover"> | |
<% @sheet.each do |row| %> | |
<tr> | |
<% row.each do |data| %> | |
<td><%= data %></td> | |
<% end %> | |
</tr> | |
<% end %> | |
</table> |