Skip to content

Instantly share code, notes, and snippets.

[gfm]
```python
s = "Python syntax highlighting"
print s
```
[/gfm]
def to_proc
Proc.new do |key=undefined|
raise ArgumentError, "wrong number of arguments (given 0, expected 1)" if undefined.equal?(key)
self[key]
end
end
require 'sinatra'
require 'rethinkdb'
include RethinkDB::Shortcuts
before do
begin
@c = r.connect(:host=>"localhost", :port=>28015)
RubyTruffleError: internal implementation error - IllegalFormatFlagsException Flags = '-0' java.util.Formatter$FormatSpecifier.checkNumeric(Formatter.java:3027)
/home/travis/build/jruby/jruby/truffle/src/main/ruby/core/string.rb:1780:in `sprintf', args: "%00.5", 11
/home/travis/build/jruby/jruby/truffle/src/main/ruby/core/string.rb:1780:in `%', args: 11
((InternalGeoBounds) geoBoundsAggregation).toXContent(XContentFactory.jsonBuilder(), null).string()
"geo_bounds_aggregation"{"bounds":{"top_left":{"lat":45.8082599658519,"lon":-157.8945400379598},"bottom_right":{"lat":20.895359991118312,"lon":-71.08765605837107}}}
@bjfish
bjfish / parallel_require_and_tests_patch.diff
Last active April 7, 2016 20:17
Experiment to Require Files in Parallel with Test Run
diff --git a/lib/elixir/mix.exs b/lib/elixir/mix.exs
index 92355fe..c46c92b 100644
--- a/lib/elixir/mix.exs
+++ b/lib/elixir/mix.exs
@@ -4,6 +4,7 @@ defmodule Elixir.Mixfile do
def project do
[app: :elixir,
version: System.version,
+ test_paths: ["test/elixir"],
build_per_environment: false]
@bjfish
bjfish / gist:6a4863518985adf45c8831b410813bdc
Last active April 4, 2016 22:30
travis for elixir master ?
language: erlang
otp_release:
- 18.0
sudo: false
before_script:
- git clone --depth=1 https://github.com/elixir-lang/elixir.git
- cd elixir && make compile && cd ..
diff --git a/lib/ex_unit/lib/ex_unit/cli_formatter.ex b/lib/ex_unit/lib/ex_unit/cli_formatter.ex
index a8f3504..cc72acc 100644
--- a/lib/ex_unit/lib/ex_unit/cli_formatter.ex
+++ b/lib/ex_unit/lib/ex_unit/cli_formatter.ex
@@ -18,7 +18,8 @@ defmodule ExUnit.CLIFormatter do
tests_counter: 0,
failures_counter: 0,
skipped_counter: 0,
- invalids_counter: 0
+ invalids_counter: 0,
$ make test
==> elixir (compile)
==> elixir (eunit)
All 194 tests passed.
==> elixir (exunit)
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
@bjfish
bjfish / gist:dcd2adcc985b475e1600
Created March 14, 2016 21:55
Cuter Example in Elixir
defmodule Example do
def bar([], s) do
:lists.sum(s)
end
def bar([x|xs], [y|ys]) do
x * y + bar(xs, ys)
end