Skip to content

Instantly share code, notes, and snippets.

View arohner's full-sized avatar

Allen Rohner arohner

View GitHub Profile
@arohner
arohner / gist:8012993
Created December 17, 2013 21:35
lein heapspace
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.LinkedList.linkLast(LinkedList.java:140)
at java.util.LinkedList.add(LinkedList.java:336)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.interpolateCollectionField(StringSearchModelInterpolator.java:276)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.interpolateField(StringSearchModelInterpolator.java:170)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:149)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:123)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateObject(StringSearchModelInterpolator.java:75)
at org.apache.maven.model.interpolation.St
@arohner
arohner / gist:8010983
Created December 17, 2013 19:21
core.typed + keys
(t/ann flag-keys (t/Map t/Keyword t/Int))
(def flag-keys
{:insensitive Pattern/CASE_INSENSITIVE
:literal Pattern/LITERAL})
(t/ann ^:no-check flags->bitmask [(t/Map t/Keyword Boolean) -> t/Int])
(defn flags->bitmask
[flags]
(->> flags
(filter val)
@arohner
arohner / gist:7149600
Created October 25, 2013 04:57
into-array>
(t/ann make-process [String -> java.lang.Process])
(defn make-process [script]
(let [^Runtime r (Runtime/getRuntime)
arr (t/into-array> String ["echo 'hello'"])]
(t/print-env "let")
(.exec r arr)))
@arohner
arohner / gist:7111364
Created October 23, 2013 02:00
rubygems failure during bundle install
Bundler::Fetcher::CertificateFailureError: Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:209:in `rescue in fetch'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:199:in `fetch'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:222:in `fetch'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:92:in `fetch_spec'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/remote_specification.rb:46:in `_remote_specification'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/gems/bundl
@arohner
arohner / gist:7089153
Created October 21, 2013 19:04
rubygems SSL clue?
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: wrong version number
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:918:in `connect'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:918:in `connect'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1445:in `begin_transport'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1402:in `transport_request'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/net/http.rb:1376:in `request'
/home/ubuntu/foo/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.2.96/lib/new_relic/agent/instrumentation/net.rb:28:in `block in request_with_newrelic_trace'
/home/ubuntu/foo/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.2.96/lib/new_relic/agent/cross_app_
@arohner
arohner / gist:7087099
Created October 21, 2013 16:54
rubygems problems
ubuntu@box55:~/arohner-test$ gem --version
2.1.9
ubuntu@box55:~/arohner-test$ gem install lazy_high_charts --version=1.1.7 --verbose
HEAD https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
ERROR: Error installing lazy_high_charts:
lazy_high_charts requires RubyGems version ~> 1.3. Try 'gem update --system' to update RubyGems itself.
@arohner
arohner / gist:7063186
Created October 20, 2013 00:14
Circle .gemrc
ubuntu@box3:~$ cat ~/.gemrc
:sources:
- https://rubygems.org
gem: --no-ri --no-rdoc
$:~/foo$ rvm --version
rvm 1.23.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
~/foo$ cat .ruby-gemset
foo
~/foo$ which bundle
/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@global/bin/bundle
remote: Counting objects: 579, done.
remote: Compressing objects: 100% (249/249), done.
remote: Total 579 (delta 303), reused 567 (delta 293)
Receiving objects: 100% (579/579), 130.75 KiB | 0 bytes/s, done.
Resolving deltas: 100% (303/303), done.
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without
using SSL, edit your Gemfile sources and change 'https' to 'http'.
@arohner
arohner / gist:6504697
Created September 10, 2013 03:43
(try+ true)
(try
true
(catch
java.lang.Throwable
&throw-context
(clojure.core/let [&throw-context (clojure.core/->
&throw-context
slingshot.support/get-context
slingshot.support/*catch-hook*)]
(clojure.core/cond