Skip to content

Instantly share code, notes, and snippets.

Mike Evans mje113

Block or report user

Report or block mje113

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:476b01e9277b2d6a197d
$ rake build
>>> Running build for core gem
install -c tmp/java/torquebox-core/torquebox-core.jar lib/torquebox-core.jar
torquebox-core 4.0.0.beta2.dev built to pkg/torquebox-core-4.0.0.beta2.dev-java.gem.
>>> Running build for messaging gem
torquebox-messaging 4.0.0.beta2.dev built to pkg/torquebox-messaging-4.0.0.beta2.dev-java.gem.
>>> Running build for scheduling gem
torquebox-scheduling 4.0.0.beta2.dev built to pkg/torquebox-scheduling-4.0.0.beta2.dev-java.gem.
View gist:b9163b4f21b3d52ad6dd
...
[ERROR] Failed to execute goal on project jbundler: Could not resolve dependencies for project no_group_id_given:jbundler:jar:0.0.0: The following artifacts could not be resolved: org.projectodd.wunderboss:wunderboss-ruby:jar:1.x.incremental.174, org.projectodd.wunderboss:wunderboss-wildfly:jar:1.x.incremental.174, org.projectodd.wunderboss:wunderboss-scheduling:jar:1.x.incremental.174, org.projectodd.wunderboss:wunderboss-web:jar:1.x.incremental.174, org.projectodd.wunderboss:wunderboss-caching:jar:1.x.incremental.174, org.projectodd.wunderboss:wunderboss-messaging:jar:1.x.incremental.174: Failure to find org.projectodd.wunderboss:wunderboss-ruby:jar:1.x.incremental.174 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable ful
View uri_bench.rb
require 'rack'
require 'rack/test'
require 'uri'
include Rack::Test::Methods
class App
def call(env)
[ '200', { 'Content-Type' => 'text/html' }, [ URI('http://example.com').to_s] ]
end
View foobar.scala
for (i <- 1 to 100) {
(i % 3, i % 5) match {
case (0, 0) => println("foobar")
case (0, _) => println("foo")
case (_, 0) => println("bar")
case _ => println(i)
}
}
View gist:43eefdeef1df6d4b57f4
class MockHystrixStream
HEADERS = {
'Content-Type' => 'text/event-stream;charset=UTF-8',
'Cache-Control' => 'no-cache, no-store, max-age=0, must-revalidate',
'Pragma' => 'no-cache',
'Transfer-Encoding' => 'chunked'
}
DATA = open(Rails.root + 'data/hystrix.stream').read.split("\n\n")
View sym_vs_string.rb
require 'benchmark/ips'
require 'securerandom'
strings = []
500.times { strings << SecureRandom.uuid }
string_hash = Hash[strings.zip]
sym_hash = Hash[strings.map(&:to_sym).zip]
string_key = strings[250]
View gist:4ca9fd1f4279ff31a40d
require 'benchmark/ips'
require 'securerandom'
require 'set'
Benchmark.ips do |x|
sizes = [ 2, 8, 32, 128, 512 ]
sizes.map! { |size| a = [].tap { |a| size.times { a << SecureRandom.uuid } } }
sizes.each do |size|
View foobar.swift
func foobar() {
for i in 1...100 {
switch (i % 3, i % 5) {
case (0, 0): println("foobar")
case (0, _): println("foo")
case (_, 0): println("bar")
default: println("\(i)")
}
}
}
View swagger.rb
require 'rack/test'
require 'swagger/docs'
Minitest.after_run {
puts Swagger.to_doc
}
module Swagger
@apis = []
View gist:3850178f89a74525f0bf
require 'java'
require 'jbundler'
require 'manticore'
class HisterixCommand < com.netflix.hystrix.HystrixCommand
java_import com.netflix.hystrix.HystrixCommand::Setter
java_import com.netflix.hystrix.HystrixCommandKey
java_import com.netflix.hystrix.HystrixCommandGroupKey
java_import com.netflix.hystrix.HystrixCommandProperties
You can’t perform that action at this time.