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
for i in [1,2,3,4,5] do | |
puts "Hello" | |
end | |
Benchmark.bm(7) do |x| | |
x.report("for:") { for i in 1..x; a = "1"; end } | |
x.report("times:") { n.times do ; a = "1"; end } | |
x.report("upto:") { 1.upto(n) do ; a = "1"; end } | |
end |
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
## Javatar Report | |
### System Informations | |
* Javatar Version: `1.0.0` | |
* Sublime Version: `3083` | |
* Package Path: `/Users/danebalia/Library/Application Support/Sublime Text 3/Packages` | |
* Javatar Channel: `stable` | |
* Sublime Channel: `stable` | |
* Is Debug Mode: `False` | |
* Platform: `osx` | |
* As Packages: `True` |
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
I truly enjoyed the assignment as it immediately layed down the foundational rules for modern software development. | |
TDD before production! Red-Green-Refactor! Also enjoying the steady increase in pace and technical knowledge, | |
and how the assignment brought the knowledge (lectures) to bear. If it's not obvious, I like that the assignment was "practical" | |
and not theoretical alone. | |
Pair programming is done frequently in my time and I don't like it. It makes me uncomfortable. But I see it's value. We are using scrum | |
and given I have a low attention to detail and can possibly rabbit hole, having pair programming at points where I hit stumblingblocks | |
has proven rather helpful, allowing to move what is blocking the pathway. | |
Solo programming is what I do best, but over the past year I've come to realise how dangerous that is. |
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 'lotus/model' | |
require 'lotus/mailer' | |
Dir["#{ __dir__ }/bookmarks/**/*.rb"].each { |file| require_relative file } | |
Lotus::Model.configure do | |
## | |
# Database adapter | |
# | |
# Available options: | |
# |
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
# Controller | |
module Web::Controllers::Home | |
class GetMetric | |
include Web::Action | |
expose :method_to_use, :query_string | |
handle_exception ArgumentError => :handle_no_query_string | |
def call(params) | |
raise ArgumentError.new('Failed to provide parameters') if params.env["QUERY_STRING"].empty? |
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
➜ shopping_cart_service git:(db_session) ✗ bundle exec lotus generate migration create_authtrackers | |
/Users/X/Documents/Github/Hetzner/shopping-cart-service/prototype/shopping_cart_service/apps/authtracker/application.rb:3:in `<top (required)>': Authtracker is not a module (TypeError) | |
from /Users/X/Documents/Github/Hetzner/shopping-cart-service/prototype/shopping_cart_service/config/environment.rb:5:in `require_relative' | |
from /Users/X/Documents/Github/Hetzner/shopping-cart-service/prototype/shopping_cart_service/config/environment.rb:5:in `<top (required)>' | |
from /Users/X/.rvm/gems/ruby-2.3.0-preview2/gems/lotusrb-0.6.0/lib/lotus/environment.rb:364:in `require' | |
from /Users/X/.rvm/gems/ruby-2.3.0-preview2/gems/lotusrb-0.6.0/lib/lotus/environment.rb:364:in `require_application_environment' | |
from /Users/X/.rvm/gems/ruby-2.3.0-preview2/gems/lotusrb-0.6.0/lib/lotus/commands/generate/migration.rb:30:in `initialize' | |
from /Users/X/.rvm/gems/ruby-2.3.0-preview2/gems/lotusrb-0.6.0/lib/lotus/cli_sub_commands/g |
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
The repo for the code is at (pretty basic): | |
https://github.com/daneb/hanami_json_oddity | |
I understand the best approach is to use a controller here and not the view. | |
But I am trying to understand the behaviour of what I am seeing. | |
In my view, when I take my hash and .to_json it, the final result from the HTTP GET is: | |
{ status: "success", data: { get: { message: 'Created new session via registration', session_id: session_id } }}.to_json | |
{"status":"success","data":{"get":{"message":"Created new session via registration","session_id":12}}} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace RackPrototype |
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 './custom_errors' | |
require './validation' | |
require 'byebug' | |
module FlattenIntegerArray | |
def self.flatten(input_array) | |
FlattenIntegerArray::Validation.not_empty_and_is_an_array?(input_array) | |
return input_array if FlattenIntegerArray::Validation.flat_array?(input_array) | |
FlattenIntegerArray::Validation.valid_input?(input_array) |
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 'rack' | |
require './cors_wired' | |
app = Rack::Builder.new do | |
use CorsWired.new | |
run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] } | |
end | |
run app |
OlderNewer