Skip to content

Instantly share code, notes, and snippets.

View universal's full-sized avatar

Johannes / universa1 universal

View GitHub Profile
Started GET "/en?utf8=%E2%9C%93&commit=test" for 127.0.0.1 at 2016-04-21 15:35:10 +0200
Processing by HomeController#index as HTML
Parameters: {"utf8"=>"✓", "commit"=>"test", "locale"=>"en"}
...
Parameters: {"utf8"=>"✓", "commit"=>"foo", "locale"=>"en"}
********************************************************************************
* Options:
* - linear: 0 -> solve quadratic dummy model
* - linear: not(0) -> solve linear model
* - funclib: yes -> include stodlib
* - funclib: not(yes) -> do not include
*
* Examples:
* ide options:
* --linear=0 --funclib=yes => slow
class BackchannelController < ApplicationController
skip_before_action :authenticate!
before_action :authenticate_internal_api!
# POST /backchannel/event
def backchannel_event
organization_id = params[:organization_id]
report_id = params[:report_id]
execution_id = params[:execution_id]
Running via Spring preloader in process 678
Loading development environment (Rails 4.2.5)
2.2.3 :001 > 1.month.ago
=> Mon, 01 Feb 2016 08:30:40 UTC +00:00
2.2.3 :002 > 1.try(:month)
=> 1 month
2.2.3 :003 > 1.try(:month).try(:ago)
=> Mon, 01 Feb 2016 08:30:58 UTC +00:00
2.2.3 :004 > 1.try('month').try('ago')
=> Mon, 01 Feb 2016 08:31:08 UTC +00:00
# minSort
def min_sort(to_sort:)
length = to_sort.length - 1
min_index = nil
for i in 0..length
min_index = i
for j in i..length
if to_sort[j] < to_sort[min_index]
<%= form_for(resource, url: registration_path(resource_name), method: :post) do |f| %>
<%= f.fields_for :contacts do |contact_fields| %>
Nome: <%= contact_fields.text_field :name %>
<% end %>
<div class="register-buttons">
<%= f.submit "Finish", class: "button button-primary", data: { disable_with: "Finish" } %>
</div>
<% end %>
class Monday; end
class Tuesday; end
class Wednesday; end
class Thursday; end
class Friday; end
Classes = [Monday, Tuesday, Wednesday, Thursday, Friday]
--- ERR
uninitialized constant User::Aimed
--- Facing cols
id, aimer_id, aimed_id, aimed_kind (will be deprecated), aimed_type, created_at, updated_at
$(document).on 'page:update', (event) ->
$("#remove_users").on 'ajax:before', (xhr, settings) ->
user_ids = ($(user).val() for user in $(@).find("ul.active-users li.internal-user input:checked"))
external_users = ($(user).val() for user in $(@).find("ul.active-users li.external-user input:checked"))
console.log users
return false if internal_users.length is 0 and external_users.length is 0
users =
params:
user_ids: user_ids
external_users: external_users
it 'should update rates when subject is accepted' do
previous_rate = subject.sale_rate
new_rate = BigDecimal.new(1)
subject.update_attribute(:sale_rate, new_rate)
expect {
subject.accept
}.to change {
subject.sale_rate
}.by new_rate - previous_rate