I hereby claim:
- I am zdennis on github.
- I am zdennis (https://keybase.io/zdennis) on keybase.
- I have a public key whose fingerprint is DF8D 39D9 9993 DFFD 7801 5D9D 3F59 51D7 5DAE D169
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
1) Grape::DSL::Validations.reset_validations! resets validations | |
Failure/Error: expect(subject.settings.peek[:validations]).to be_empty | |
expected to respond to `empty?` | |
# ./spec/grape/dsl/validations_spec.rb:30:in `block (3 levels) in <module:DSL>' | |
2) Grape::Validations::PresenceValidator with a required non-empty string requires when missing | |
Failure/Error: expect(last_response.body).to eq('{"error":"email is missing, email is invalid"}') | |
expected: "{\"error\":\"email is missing, email is invalid\"}" | |
got: "{\"error\":\"email is missing\"}" |
"_links": { | |
"curies": [ | |
{ | |
"name": "doc", | |
"href": "http://haltalk.herokuapp.com/docs/{rel}", | |
"templated": true | |
} | |
], | |
// this is the "latest-posts" link relation. The base documentation URL can change |
# +cbranch+ returns the current branch you are on | |
cbranch = !"git branch | grep '*' | cut -f2 -d' '" | |
# +open-url+ opens the home page for this repository | |
open-url = !"open `git remote show origin | grep 'Fetch URL' | ruby -e \"puts 'http://' + STDIN.read.scan(/Fetch URL: git@(.*)/).join.sub(':', '/').sub('.git','')\"`" | |
# +open-branch+ opens the current branch in your default browser | |
open-branch = !"open `git remote show origin | grep 'Fetch URL' | ruby -e \"puts 'http://' + STDIN.read.scan(/Fetch URL: git@(.*)/).join.sub(':', '/').sub('.git','') + \\\\\"/tree/#{%x|git cbranch|}\\\\\"\"`" | |
# +open-sha+ opens the current SHA in your default browser |
# simple character binding | |
#"z":"echo hello world" | |
# controler character binding | |
#"\C-g":"echo goodbye world" | |
# function key binding | |
# "\033OP":"echo f1" | |
# "\eOQ":"echo f2" |
100.times do | |
r,w = IO.pipe | |
pid1 = Process.spawn(Hash.new, "echo", "foo\nbar\nbaz\nfood", out: w) | |
pid2 = Process.spawn(Hash.new, "grep", "foo", in: r) | |
foo = Process.waitpid2(pid1) | |
# don't forget to close the write pipe, otherwise this will hang on the second process indefinitely | |
w.close | |
bar = Process.waitpid2(pid2) | |
class Surveys::ReportController < ApplicationController | |
def show | |
Survey.find() | |
end | |
end |
repl.rb
which will echo what you print unless you enter "irb".This seems to not be a problem with irb, but any child process that calls "gets". If you launch "irb" from bash though and do the same steps, bash doesn't exhibit this issue, just a ruby REPL.
=begin | |
Cuboid room: | |
* consider all integer up to cuboids: M x M x M | |
* where M = 100 | |
* a^2 + b^2 = c^2 | |
* c = sqrt(a^2 + b^2) | |
* shortest path thru cuboid: Math.sqrt( l**2 + (w + h)**2 ) | |
=end |
#!/usr/bin/ruby | |
require 'chronic' | |
require 'term/ansicolor' | |
# | |
# Configuring your prompt. This can be set to a static value or to a | |
# Proc like object that responds to #call. If it responds to call it will | |
# be used every time the prompt is to be re-drawn | |
# |