Skip to content

Instantly share code, notes, and snippets.

View glebm's full-sized avatar

Gleb Mazovetskiy glebm

View GitHub Profile
@glebm
glebm / gist:4235007
Created December 7, 2012 17:44
puma + jruby journey error
NoMethodError (undefined method `names' for nil:NilClass):
/Users/glebm/.rvm/gems/jruby-head@jl/gems/journey-1.0.4/lib/journey/router.rb:137:in `find_routes'
org/jruby/RubyArray.java:2360:in `map'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/journey-1.0.4/lib/journey/router.rb:132:in `find_routes'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/actionpack-3.2.9/lib/action_dispatch/routing/route_set.rb:601:in `call'
/Users/glebm/justlanded/lib/rack/ec2_uploader/lib/ec2_uploader/rack_app.rb:25:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/newrelic_rpm-3.5.3.25/lib/new_relic/rack/error_collector.rb:8:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/newrelic_rpm-3.5.3.25/lib/new_relic/rack/browser_monitoring.rb:12:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/newrelic_rpm-3.5.3.25/lib/new_relic/rack/developer_mode.rb:24:in `call'
@glebm
glebm / gist:4240917
Created December 8, 2012 16:37
ActionView::Template::Error (not opened for writing)
125642:ActionView::Template::Error (not opened for writing):
125643- 3: .sign_inner.location-selector
125644- 4: .selects
125645- 5: - selected = localiser.application_location.world? ? nil : localiser.application_location
125646- 6: - cache "#{localiser.locale.cache_key}/#{selected.try(:cache_key) || "w"}/main_loc_selector", expires_in: 24.hours do
125647- 7: = country_select selected: selected.try(:country).try(:id), class: 'combobox'
125648- 8: - if selected.try(:country).try(:has_children?)
125649- 9: = region_and_city_select selected, :class => "combobox"
125650- org/jruby/ext/stringio/RubyStringIO.java:992:in `write'
125651- org/jruby/RubyIO.java:2376:in `write'
@glebm
glebm / gist:4240962
Created December 8, 2012 16:45
Puma error
2012-12-08 17:41:03 +0100: Rack app error: #<NoMethodError: undefined method `>' for nil:NilClass>2012-12-08 17:41:03 +0100: Rack app error: #<NoMethodError: undefined method `>' for nil:NilClass>
/Users/glebm/.rvm/gems/jruby-head@jl/gems/rack-cache-1.2/lib/rack/cache/context.rb:251:in `fetch'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/rack-cache-1.2/lib/rack/cache/context.rb:49:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/railties-3.2.9/lib/rails/engine.rb:479:in `call'
/Users/glebm/.rvm/gems/jruby-head@jl/gems/railties-3.2.9/lib/rails/application.rb:223:in `call'
org/jruby/RubyBasicObject.java:1665:in `__send__'
org/jruby/RubyKernel.java:2090:in `send'
@glebm
glebm / gist:4254783
Created December 11, 2012 00:55
Error: bad file descriptor
ActionView::Template::Error (Bad file descriptor - Bad file descriptor):
5: else
6: url = create_item_path
7: text = I18n.t("common.post_free_ad")
8: end
9: %a.post-free-ad{href: url}
10: %span.icons.icon-myposts
11: %span.icon-text= text
/usr/justlanded/apps/deploy/releases/20121211003656/app/views/classifieds/shared/_post_free_ad_button.html.haml:8:in `_app_views_classifieds_shared__post_free_ad_button_html_haml___675504869_21714'
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode):
"JRubyWorker-3" daemon prio=10 tid=0x00007f36dc028000 nid=0x432e waiting on condition [0x00007f3720f41000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006eaaf1970> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1085)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807)
@glebm
glebm / gist:4430698
Created January 1, 2013 22:50
Yet another stack dump
This file has been truncated, but you can view the full file.
Deadlock Detection:
No deadlocks found.
Thread 22209: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information may be imprecise)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20, line=226 (Interpreted frame)
- java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(java.util.concurrent.SynchronousQueue$TransferStack$SNode, boolean, long) @bci=174, line=460 (Compiled frame)
- java.util.concurrent.SynchronousQueue$TransferStack.transfer(java.lang.Object, boolean, long) @bci=102, line=359 (Interpreted frame)
- java.util.concurrent.SynchronousQueue.poll(long, java.util.concurrent.TimeUnit) @bci=11, line=942 (Interpreted frame)
#!/usr/bin/env ruby
# coding: utf-8
require 'net/http'
require 'json'
# a simple wrapper to do an HTTPS GET
def fetch_uri(url)
STDERR.puts "GET #{url}" if ENV['VERBOSE']
uri = URI(url)
@glebm
glebm / karma.log
Created April 15, 2013 03:44
angularjs karma
Chrome 26.0 (Mac) railsResourceFactory singular should be able to delete to arbitrary url FAILED
Error: Expected DELETE /xyz with different headers
EXPECTED: {"test":{"id":123,"abc":"xyz","xyz":"abc"}}
GOT: {"Accept":"application/json"}
at Error (<anonymous>)
at $httpBackend (/Users/glebm/angularjs-rails-resource/test/lib/angular/angular-mocks.js:931:15)
at sendReq (/Users/glebm/angularjs-rails-resource/test/lib/angular/angular.js:9980:9)
at $http.serverRequest (/Users/glebm/angularjs-rails-resource/test/lib/angular/angular.js:9757:16)
at wrappedCallback (/Users/glebm/angularjs-rails-resource/test/lib/angular/angular.js:7303:59)
at wrappedCallback (/Users/glebm/angularjs-rails-resource/test/lib/angular/angular.js:7303:59)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>homebrew.mxcl.redis</string>
<key>ProgramArguments</key>
<array>
@glebm
glebm / form_helper.js.coffee
Last active December 17, 2015 19:09
AngularJS Form Helper
angular.module('myApp').factory 'FormHelper', [->
class FormHelper
constructor: (scope, object, formName) ->
@scope = scope
@formName = formName
@object = -> @scope[object]
scope.$watch "#{formName}.$pristine", (pristine) =>
@unsaved = !pristine
@saved = false unless pristine
scope.$watch "#{formName}.$valid", (valid) =>