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
// Configure accordingly | |
window._crashmat = {key:'abc123'}; | |
// Capture errors | |
(function(w, cm, woe) { | |
w.onerror = function(e,f,l,c) { | |
cm.e = cm.e || []; cm.e.push([e,f,l,c]); | |
if (woe) woe(e,f,l,c); | |
}; | |
})(window, window._crashmat, window.onerror); |
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
require 'test_helper' | |
class AllLinksRenderTest < ActionDispatch::IntegrationTest | |
test "all links render" do | |
self.host = "example.com" | |
spider "/" | |
end | |
def spider(path, spidered=[]) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>App title</title> | |
<% if ActionController::Base.asset_host %> | |
<link rel="dns-prefetch" href="//<%= ActionController::Base.asset_host %>" /> | |
<% 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
# Brunch - http://brunch.io/ | |
# | |
# Using uglify-js-brunch - https://github.com/brunch/uglify-js-brunch | |
# | |
# Use the following settings in your Brunch configuration file | |
exports.config = | |
plugins: | |
uglify: | |
output: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My App</title> | |
<script> | |
window.Crashmat = { | |
key: "[your key]", | |
user: <%= raw crashmat_user.to_json.gsub("</", "<\\/") %> | |
}; |
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
# Add the following configuration to your config/environments/development.rb file | |
# | |
# This will set the Rails to log to STDOUT (insetad of log/development.log) as well | |
# as tag all assets request log lines with [assets] | |
# | |
# You can then pipe it into grep to filter out the asset lines | |
# | |
# tail -f log/development.rb | grep -v '\[assets\]' | |
# | |
# If you log to STDOUT rather than log/development.rb then you can: |
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_1: foreman start --root app_1 --port 3000 --env app_1/.env | |
app_2: foreman start --root app_2 --port 3100 --env app_2/.env | |
app_3: foreman start --root app_3 --port 3200 --env app_3/.env |
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
#!/usr/bin/env ruby | |
# | |
# Uploads a file to a S3 and prints a private, expiring URL to STDOUT | |
# | |
# Requirements: aws-s3 gem | |
if ARGV.length != 3 | |
abort "Usage: #{$0} FILE BUCKET EXPIRY_IN_SECONDS" | |
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
# Gemfile | |
group :development do | |
gem 'mail_preview' | |
end | |
# config/initializers/mail_preview.rb | |
MailPreview.configure do |c| | |
c.litmus subdomain: "company", |
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
require 'sinatra' | |
require 'sinatra/assetpack' | |
assets do | |
js :app, '/app.js', ['js/*.js'] | |
js_compression :uglify, | |
# Add new lines | |
beautify: true, | |
# Don't add indentation | |
beautify_options: {indent_level: 0} |