Skip to content

Instantly share code, notes, and snippets.

View Keqi's full-sized avatar

Maciej Nowak Keqi

View GitHub Profile
airtable_cohorts = Airtable::ProgramStructureApi.new.cohorts
ProgramCohort.find_each do |pc|
r = airtable_cohorts.find { |record| record.fields['Cohort Name'] == pc.name }
next unless r
pc.update(external_id: r.id) if pc.external_id != r.id
end
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
require 'httparty'
class UsersWorker
include Sidekiq::Worker
HOSTNAME = 'https://interview-api-app.herokuapp.com/users'
def perform(options={})
page_size = options[:page_size] || 10
page = options[:page] || 1
class User
def admin?
role == 'admin'
end
def marketer?
role == 'marketer'
end
def sales?
class User
def admin?
role == 'admin'
end
def marketer?
role == 'marketer'
end
def sales?
<div class="row mt-3">
<div class="col-10">
<table class="table dashboard-daily-table">
<thead class="thead-light dashboard-daily-table-header">
<tr>
<th width="18%" scope="col"><%= Date.today.strftime("%A") %></th>
<th width="64%" scope="col"></th>
<th width="18%" scope="col"></th>
</tr>
</thead>
@Keqi
Keqi / problem.rb
Last active January 9, 2020 15:55
class ProjectsController < ApplicationController
# student.project is the reference to associated AR Project model.
def users_projects
teams = Team.all
students = teams.map(&:students).flatten
@student_projects = students.select do |student|
student.project.status == "Active"
end
end
public class Koło {
int promień;
public Koło(int a){
promień = a;
}
}