# Add remote origin pointing to fork, if it is not added
git remote add origin git@github.com:waterlink/contracts.ruby.git
# Add remote upstream pointing to main repo, if it is not added
git remote add upstream git@github.com:egonSchiele/contracts.ruby.git
# Fetch latest master from upstream
git fetch upstream master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/FETCH_HEAD:lib/rack/reverse_proxy.rb b/HEAD:lib/rack_reverse_proxy/middleware.rb | |
index 46416df..420f35b 100644 | |
--- a/FETCH_HEAD:lib/rack/reverse_proxy.rb | |
+++ b/HEAD:lib/rack_reverse_proxy/middleware.rb | |
@@ -1,177 +1,175 @@ | |
-require 'net/http' | |
-require 'net/https' | |
+require "net/http" | |
+require "net/https" | |
+require "rack-proxy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile(true) do | |
ruby "2.2.3" | |
source "https://rubygems.org" | |
gem "contracts", "0.11.0" | |
end | |
require "contracts" | |
require "contracts/version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "contracts" | |
class Something | |
module WithSettings | |
def self.included(base) | |
base.class_eval do | |
include Contracts | |
Contract Contracts::None => Contracts::ArrayOf[String] | |
def emails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⇒ GC_DONT_GC=1 bin/test | |
. | |
Finished in 0.41 milliseconds | |
1 examples, 0 failures, 0 errors, 0 pending | |
ActiveRecord::Model | |
.new | |
creates person | |
doesn't have id | |
doesn't have any else field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⇒ gdb integration/integration_spec | |
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 | |
Copyright (C) 2014 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-linux-gnu". | |
Type "show configuration" for configuration details. | |
For bug reporting instructions, please see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Model | |
.new | |
creates person | |
doesn't have id | |
doesn't have any else field | |
doesn't care about non-defined fields | |
.fields | |
returns fields defined on model | |
#== | |
is equal object to object with the same fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.where(query_hash) | |
finds multiple records==957== Invalid read of size 8 | |
==957== at 0x4A0FB5: GC_generic_malloc_many (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x4AA30E: GC_malloc_atomic (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x4A06EC: GC_generic_or_special_malloc (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x4A08AA: GC_realloc (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x4142E5: __crystal_realloc (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x42068E: *Pointer(UInt8)@Pointer(T)#realloc<Pointer(UInt8), Int32>:Pointer(UInt8) (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== by 0x4199B6: *String::Builder#resize_to_capacity<String::Builder, Int32>:Pointer(UInt8) (in /home/oleksii/code/github/waterlink/mysql_adapter.cr/integration_spec) | |
==957== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <curses.h> | |
#include <stdio.h> | |
#define pp(x, d) printf("% 15s = % 10lu # - %s\n", #x, x, #d); | |
int main() { | |
pp(A_NORMAL, Normal display (no highlight)) | |
pp(A_STANDOUT, Best highlighting mode of the terminal.) | |
pp(A_UNDERLINE, Underlining) | |
pp(A_REVERSE, Reverse video) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Smelly code | |
class Example | |
def do_stuff(something) | |
return if invalid_thing?(something) | |
@thing = something | |
end | |
private def invalid_thing?(thing) | |
# determine if thing is valid | |
end |