Skip to content
View ci.sh
#!/bin/bash
set -e
export RAILS_ENV=test
export DISABLE_SPRING=1
source /usr/local/rvm/scripts/rvm
rvm use ruby-2.2.1
bundle install --path=vendor > log/bundle_install.log
View rubygems-timeout.txt
Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - connect(2) for "rubygems.org" port 443 (https://rubygems.org/gems/rspec-rails-3.3.1.gem)
An error occurred while installing rspec-rails (3.3.1), and Bundler cannot continue.
Make sure that `gem install rspec-rails -v '3.3.1'` succeeds before bundling.
View test.rb
# including a module as private in ruby, does not change anything
# to test
mixin_methods = Mixin.instance_methods
controller = SomeController.new
status = mixin_methods.each_with_object({}) { |x, acc| acc[x] = controller.respond_to?(x) }
status.select { |k,v| !v }.keys # will be empty
View migration_file_with_error.rb
class SetupHstore < ActiveRecord::Migration
def up
execute "CREATE EXTENSION IF NOT EXISTS hstore"
end
def down
execute "DROP EXTENSION IF EXISTS hstore"
end
end
View homebrew segfault due to readline
➜ ~ brew upgrade wget
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/readline.bundle: [BUG] Segmentation fault
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
View consumer.es.js
export {Worker} from './package';
View next in yielded method.es.js
let price = 10;
let stockPrice = function () {
setTimeout(function() {
iterator.next(price++);
}, 300);
}
let badStockPrice = function () {
iterator.next(price++);
View wrap_errors_for_generators.es.js
// works: https://gist.github.com/deepak/ffe01c81900d12f95658
// does not work: https://gist.github.com/deepak/9a7337d7a641f8af9c8b
// difference is that, if error is thrown directly from fucntion called in generator
// then it gives a "Generator is already running" error
// but if it is wrapped in a setTimeout callback then it works
// WORKS
let price = 10;
View errors_in_generator.es.js
let price = 10;
let stockPrice = function () {
setTimeout(function() {
iterator.next(price++);
}, 300);
}
let errorInStockPrice = function() {
setTimeout(function() {
View get_stock_price.es.js
let price = 10;
let stockPrice = function () {
setTimeout(function() {
iterator.next(price++);
console.log(price); //=> 10
// why is this logged ? next does not behave like return ?
// and it is always 10. "price++" did not increment value of price
}, 300);
}
Something went wrong with that request. Please try again.