Skip to content

Instantly share code, notes, and snippets.

🎯
Busy creating tech debt

Avi Das avidas

🎯
Busy creating tech debt
Block or report user

Report or block avidas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@avidas
avidas / rubyconf.md
Last active Nov 20, 2018
RubyConf 2018 Notes
View rubyconf.md

RubyConf 2018 Notes

Keynote by Matz (Ruby Creator)

  • Why do people create programming languages?
  • C was designed to replace assembly to write OS
  • Matz wrote Ruby for fun
  • People write programming languages, why not me
  • Japanese aesthetic/minimalism in Ruby

The games developers play (Andy Croll)

View REVENG-580.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code("DYD9GC")
location = Location.find_by_code("LON11")
# Get billing period
start_of_two_months_ago = Date.today.last_month.last_month.beginning_of_month
end_of_two_months_ago = Date.today.last_month.last_month.end_of_month
two_months_ago_range = start_of_two_months_ago..end_of_two_months_ago
billing_period = two_months_ago_range # Invoice for December covers Nov 1 - Nov 30th
View HDA_unarchive.rb
begin
TenantService.switch_to_rest_of_world_tenant
location = Location.find_by_code("VAN01")
floor = Floor.find_by(location_id: location.id, floor_number: 16)
hda = HotDeskArea.find_by(floor_id: floor.id)
hda.update_attributes(archived_at: nil)
end
View 570.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code 'HUJW06'
pr = account.primary_reservations.active.find_by(description: '02-15')
pr.update_attributes(price: 4300.0)
end
View 569.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code '1VHUN0'
pr = account.primary_reservations.active.find_by(description: '03-01')
pr.update_attributes(price: 23400.0)
end
View 549.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code '7MY9PT'
primary_reservations = account.primary_reservations.active.where(description: ['2132', '2133', '2134', '2135', '2137'])
# Set commitment terms
start_date = Date.today.next_month.beginning_of_year
months = 6
primary_reservations.map{|res| CommitmentTermService.new(res).create(months, start_date) }
end
View REVENG-566.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by short_code: 'F469UC'
res = account.primary_reservations.active.find_by(description: 'DD - 15')
# need to find this way since res.commitment_term won't show a future term
term = CommitmentTerm.find_by(termable: res)
term.archive! if term.active?
raise 'Still has active term' if term.reload.active?
end
View BJGQA0_term.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code 'BJGQA0'
pr = account.primary_reservations.active.find_by(description: '9068')
ct_start = Date.today.beginning_of_year.next_year # 01/01/2018
ct_duration = 24
CommitmentTermService.new(pr).update(ct_duration, ct_start)
end
View B1F4AJ_term.rb
begin
TenantService.switch_to_rest_of_world_tenant
account = Account.find_by_short_code 'B1F4AJ'
pr = account.primary_reservations.active.find_by(description: '411')
ct_start = Date.today.beginning_of_year.next_year # 01/01/2018
ct_duration = 12
CommitmentTermService.new(pr).create(ct_duration, ct_start)
end
View NBC_term.rb
begin
TenantService.switch_to_rest_of_world_tenant
nbc = Account.find_by_short_code 'A0XA74'
congress_res = nbc.primary_reservations.active.find_by(description: '16104')
ct_start = Date.today.beginning_of_year.next_year # 01/01/2018
ct_duration = 6
CommitmentTermService.new(congress_res).create(ct_duration, ct_start)
end
You can’t perform that action at this time.