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
FROM ruby:2.7.5-bullseye | |
RUN apt-get update && apt-get install vim -y | |
# throw errors if Gemfile has been modified since Gemfile.lock | |
RUN bundle config --global frozen 1 | |
RUN adduser --disabled-login app_owner | |
USER app_owner |
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
# Aggregation | |
SELECT "id", "language_id", "content", "created_at", "updated_at", | |
SIMILARITY("content", 'I''m light as a frog') AS "similarity" FROM "segments" | |
WHERE (("language_id" = 5) AND (similarity("content", 'I''m light as a frog') > 0.45)) | |
ORDER BY SIMILARITY("content", 'I''m light as a frog') | |
DESC | |
SELECT "translation_records"."id", "translation_records"."source_segment_id", | |
"translation_records"."target_segment_id", "translation_records"."domain_id", | |
"translation_records"."style_id", "translation_records"."project_name", |
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
# segment repository | |
class SegmentRepository < Hanami::Repository | |
associations do | |
has_many :translation_records | |
has_many :segments, through: :translation_records, as: :target_segments | |
belongs_to :language | |
end | |
def find_by_segment_match(source_text_for_lookup, source_lang, target_lang, sim_score, max_results) | |
aggregate(:translation_records) |
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
Views | |
tmsr/apps/godmode/views/contact_persons/edit.rb | |
module Godmode | |
module Views | |
module ContactPersons | |
class Edit | |
include Godmode::View | |
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 'ruby2d' | |
set( { :title => "Project", :background => "navy", :width => 640, :height => 640, } ) | |
class Tank | |
attr_accessor :x, :y, :width, :height | |
def initialize | |
@x = (get :width) / 2 | |
@y = (get :height) / 2 |
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
NoMethodError: undefined method `period' for #<Hanami::View::Rendering::Scope:0x007f4c29979510> | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-view-1.1.0/lib/hanami/view/rendering/layout_scope.rb:236:in `method_missing' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-view-1.1.0/lib/hanami/view/rendering/scope.rb:81:in `method_missing' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-helpers-1.1.1/lib/hanami/helpers/html_helper/html_builder.rb:383:in `method_missing' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-helpers-1.1.1/lib/hanami/helpers/html_helper/html_builder.rb:383:in `method_missing' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-helpers-1.1.1/lib/hanami/helpers/html_helper/html_builder.rb:383:in `method_missing' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-helpers-1.1.1/lib/hanami/helpers/html_helper/html_builder.rb:383:in `method_missing' | |
/home/seba/projekti/hanami/egu_1/egu_app/apps/web/templates/slots/edit.html.erb:17:in `block (5 levels) in singleton class' | |
/home/seba/.rvm/gems/ruby-2.4.1/gems/hanami-helpers-1 |
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
<h2>Update guild</h2> | |
<% unless params.valid? %> | |
<div class="errors"> | |
<h3>Input error</h3> | |
<ul> | |
<% params.error_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> |
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
module Web | |
module Logging | |
def self.included(action) | |
action.class_eval do | |
unless ENV['HANAMI_ENV'] == "test" | |
before :write_to_log | |
end | |
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
server { | |
listen 80; | |
server_name domain_name.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { |
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
(eval):2: warning: method redefined; discarding old link | |
(eval):2: warning: previous definition of link was here | |
/home/sebastjan/.rvm/gems/ruby-2.2.1/bundler/gems/view-6a51e5cd3daf/lib/hanami/presenter.rb:1: warning: loading in progress, circular require considered harmful - /home/sebastjan/.rvm/gems/ruby-2.2.1/bundler/gems/view-6a51e5cd3daf/lib/hanami/view/escape.rb | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:4:in `<main>' | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:4:in `select' | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:9:in `block in <main>' | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:9:in `each' | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>' | |
from /home/sebastjan/.rvm/gems/ruby-2.2.1/gems/rake-11.1.2/lib/rake/rake_test_loader.rb:10:in `require' |
NewerOlder