I hereby claim:
- I am michaelminter on github.
- I am mothore (https://keybase.io/mothore) on keybase.
- I have a public key whose fingerprint is 0942 D325 3CA7 C25D 4E4C C5D0 2253 37AC 24A2 5BD1
To claim this, I am signing this object:
module Contents | |
class ExerciseWrapper < Contents::BaseWrapper | |
attribute :name, String | |
attribute :type | |
validate :name, presence: true | |
def to_fhir | |
{ | |
one: :attribute_name, |
# app/models/model_name.rb | |
class ModelName < ActiveRecord::Base | |
include Tokenable | |
end | |
# app/models/concerns/tokenable.rb | |
module Tokenable | |
extend ActiveSupport::Concern | |
included do |
class MoneyHandling | |
def least_number_coins(amount_cents) | |
coins = [25, 10, 5, 1] | |
remaining = amount_cents | |
count = {} | |
coins.each do |coin| | |
if amount_cents > coin | |
remainder = (remaining / coin).floor | |
count[coin] = remainder |
#!/usr/bin/env python2 | |
import athenahealthapi | |
import datetime | |
import csv | |
# Set up | |
key = 'FILTERED' | |
secret = 'FILTERED' | |
version = 'FILTERED' | |
practice_id = 123 |
# Assigns time zone to local time zone. Then sets back. | |
# @param [String] tz_name | |
# @example | |
# with_time_zone 'UTC' { something() } | |
def with_time_zone(tz_name) | |
prev_tz = ENV['TZ'] | |
ENV['TZ'] = tz_name | |
yield | |
ensure | |
ENV['TZ'] = prev_tz |
problem = Problem.select('problems.*, COUNT(problem_questions.id) AS problem_question_count') | |
.joins(Problem.arel_table.join(ProblemProblemQuestion.arel_table, Arel::Nodes::OuterJoin).on(ProblemProblemQuestion.arel_table[:problem_id].eq(Problem.arel_table[:id])).join_sources) | |
.joins(ProblemProblemQuestion.arel_table.join(ProblemQuestion.arel_table, Arel::Nodes::OuterJoin).on(ProblemQuestion.arel_table[:id].eq(ProblemProblemQuestion.arel_table[:problem_question_id]).and(ProblemQuestion.arel_table[:public].eq(true))).join_sources) |
SELECT `problems`.* FROM `problems` LEFT OUTER JOIN `subject_nodes` ON `subject_nodes`.`id` = `problems`.`subject_node_id` WHERE `problems`.`deleted` = 0 AND (`problems`.`problem_subject_id` = 74 AND `problems`.`public` = 1 AND `problems`.`problem_set_type` IN (1, 2, 4) AND 'IF(problems.problem_set_type=4 AND problems.subject_node_id IS NOT NULL, subject_nodes.parent_id, problems.id) IS NOT NULL') | |
WHERE IF(problems.problem_set_type=4 AND problems.subject_node_id IS NOT NULL, subject_nodes.parent_id, problems.id) IS NOT NULL | |
WHERE IF(problems.problem_set_type=4 AND problems.subject_node_id IS NOT NULL, subject_nodes.parent_id IS NOT NULL, '') | |
WHERE (CASE problems.problem_set_type=4 AND problems.subject_node_id IS NOT NULL THEN subject_nodes.parent_id IS NOT NULL) |
class ApiLogger < Grape::Middleware::Base | |
def before | |
Rails.logger.info "[api] Requested: #{request_log_data.to_json}\n" + | |
"[api] #{response_log_data[:description]} #{response_log_data[:source_file]}:#{response_log_data[:source_line]}" | |
end | |
private | |
def request_log_data |
class Board | |
attr_accessor :board | |
# Establishes new Boggle board | |
# | |
# @return [Array] an array of 4 rows containing an array of 4 columns of letters | |
def initialize | |
@board = (0..3).map{ Array.new(4){ [*'a'..'z'].sample } } | |
@words = [] | |
end |
I hereby claim:
To claim this, I am signing this object: