Skip to content

Instantly share code, notes, and snippets.

View yohanmishkin's full-sized avatar

yohanmishkin yohanmishkin

View GitHub Profile
@yohanmishkin
yohanmishkin / acceptance-test.js
Created April 12, 2019 20:32
Testing polling in Ember
module('Acceptance | Rooms', () => {
test('Room page polls for room data', async function(assert) {
assert.expect(2);
let pollingServiceMock = {
start(fetchingTaskInstance, pollingFrequency) {
assert.ok(fetchingTaskInstance, 'Polling started for rooms');
assert.equal(pollingFrequency, 5000, 'Poll every 5 seconds');
}
};
@yohanmishkin
yohanmishkin / doc.md
Last active December 31, 2019 07:06
Multi-stage builds in docker

Multi-stage builds in docker

Having spent a bit of time working to dockerize an API I wanted to share one of my learnings in case it’s helpful or interesting to others.

Granting access to private git repositories

The first issue I ran into was how to authenticate requests to gems we host privately on Github. We do this quite a bit throughout our repos.

So I needed a way to grant access to our docker image in order for bundler to run properly. Because were trying to build for production deployment I first decided to remove HTTPS repository references (https://github.com/ldock/) and replace them with SSH URLs ([email protected]:ldock/). But this introduced the challenge of getting the private key on the container securely. I needed the ability to get an authorized SSH key on the image when dependencies were being installed (bundle install) but I did not want to leave the key on the file system after the dependencies were installed.

@yohanmishkin
yohanmishkin / controllers.application.js
Last active September 5, 2019 14:10
dependent macros
import Ember from 'ember';
import { filterBy, readOnly, setDiff } from '@ember/object/computed';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
things: readOnly('model'),
truths: filterBy('things', 'is', true),
untruths: setDiff('things', 'truths'),
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
tags: [],
blah: computed('[email protected]', function() {
if (isPresent(this.tags)) {
return get(this, 'tags')
.rejectBy('isDeleted')