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
<?php | |
function isEnabled() { | |
return SHOULD_BE_ENABLED; | |
} | |
function reportMessage(msg) { | |
if (isEnabled()) { | |
Rollbar::report_message(msg); | |
} |
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
require 'rollbar' | |
class DeepException < StandardError | |
def initialize(msg) | |
super "'#{msg}' from the deep" | |
end | |
end | |
class ShallowException < StandardError | |
def initialize(msg) |
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
source 'https://rubygems.org' | |
gem 'cuba' | |
gem 'rollbar' |
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
require 'rollbar' | |
Rollbar.configure do |config| | |
config.access_token = "MY ACCESS TOKEN" | |
config.enabled = should_i_send_to_rollbar? | |
end | |
begin | |
run_my_script ARGV | |
rescue e | |
Rollbar.error e |
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
class DemoController < ApplicationController | |
around_action :rollbar_scope_setup | |
private | |
def rollbar_scope_setup | |
Rollbar.scoped(setup_your_custom_stuff_here) { yield } | |
end | |
end |
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
class MyClass | |
attr_reader :a:, :b | |
def initialize(a, b) | |
@a, @b = a,b | |
end | |
def process | |
rescue => e | |
rollbar.error(e) |
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
using System; | |
using System.Windows.Forms; | |
using Valetude.Rollbar; | |
namespace MyCompany.Whatever | |
{ | |
internal static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. |
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
var accessToken = "READ_ACCESS_TOKEN"; | |
function fetchPage(accessToken, cb, page) { | |
if (page == null) { | |
page = 1; | |
} | |
var url = "https://api.rollbar.com/api/1/items/?access_token={0}&page={1}&status=active", | |
items = []; | |
$.ajax({ |
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
# In Application Controller: | |
# Rename your current version of 'current_user' like so: | |
def _current_user | |
# Current User Code | |
end | |
# Change _current_user to something like this: | |
def current_user | |
model = self.class.class_variable_get :@@model rescue nil |
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
{{#if results}} | |
<header><h3>Results</h3></header> | |
<div><button on-click="saveCSV()">Export As CSV</button></div> | |
{{#each resultSets}} | |
<div class='resultset'> | |
<h4> | |
<span>{{db}}</span> | |
{{#if statistics.SelectRows || statistics.SelectCount}} | |
<span class='counts'>{{statistics.SelectRows}} row(s) selected with {{statistics.SelectCount}} select(s)</span> | |
{{/if}} |