The judge of any court of record, before whom any witness is summoned or sworn and examined as an expert in any profession or calling, may allow such fees or compensation as may be just and reasonable.