Skip to content

Instantly share code, notes, and snippets.

View benedikt's full-sized avatar

Benedikt Deicke benedikt

View GitHub Profile
@benedikt
benedikt / array_each.rb
Created October 23, 2013 09:28
In Rubinius, the `Array#each` method does not enumerate elements that are added while enumerating. Is this intentional or a bug?
array = [1, 2]
array.each { |n| array << n * 2; break if n > 10 }
array
# ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
# => [1, 2, 2, 4, 4, 8, 8, 16, 16, 32]
# rubinius 2.1.1 (2.1.0 be67ed17 2013-10-18 JI) [x86_64-darwin12.5.0]
# => [1, 2, 2, 4]
@benedikt
benedikt / Howto.md
Last active January 4, 2016 06:09
Setting up AppSignal on Shelly Cloud

Setting up AppSignal on Shelly Cloud

To set up AppSignal on Shelly Cloud, you first have to add both the dotenv-rails and the appsignal gem to your Gemfile. Make sure that the dotenv-rails gem is the very first gem in your Gemfile as it will set up important environment variables as soon as it is required.

# Gemfile

source 'https://rubygems.org'

gem 'dotenv-rails'
@benedikt
benedikt / appsignal.rb
Last active October 12, 2018 13:23
Sidekiq Queue Sizes in AppSignal
# Be sure to also enable minutely probes. For example by setting APPSIGNAL_ENABLE_MINUTELY_PROBES=true
require 'sidekiq/api'
class Appsignal::SidekiqProbe
def call
Sidekiq::Queue.all.each do |queue|
Appsignal.set_gauge("sidekiq.queues.#{queue.name}", queue.size)
end
end
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@benedikt
benedikt / controllers.application\.js
Last active November 21, 2020 19:31
is-pending with array
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}