Skip to content

Instantly share code, notes, and snippets.

Avatar
🌤️
Stoked on Terraforming

Matt Gowie Gowiem

🌤️
Stoked on Terraforming
View GitHub Profile
View null_label_version_bump.sh
#!/bin/zsh
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -f versions.tf ]; then
echo "Too old."
exit 0
View test_all_comments.sh
#!/bin/bash
GITHUB_USERNAME=Gowiem
MINS_AGO=$(date -v-30M -u +"%Y-%m-%dT%H:%M:%SZ")
PRS_CREATED_RECENTLY=$(curl -u $GITHUB_USERNAME:$GITHUB_API_TOKEN \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/issues?since=$MINS_AGO&per_page=100")
PR_URLS=($(echo $PRS_CREATED_RECENTLY | jq -r ".[].pull_request.url | @sh"))
View update_pinnings.sh
#!/bin/bash
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -f versions.tf ]; then
echo "Too old."
exit 0
@Gowiem
Gowiem / chatops.sh
Created Jul 7, 2020
CloudPosse Terraform ChatOps Update
View chatops.sh
#!/bin/bash
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -d ./test/src/ ]; then
echo "Too old."
exit 0
View keybase.md

Keybase proof

I hereby claim:

  • I am Gowiem on github.
  • I am gowiem (https://keybase.io/gowiem) on keybase.
  • I have a public key whose fingerprint is A9EF C5FB 5653 47B5 9038 2B42 2838 626E 0AAC 0ECD

To claim this, I am signing this object:

@Gowiem
Gowiem / remote_config.yml
Last active Nov 28, 2018
Remote config file for Ansible playbook take home interview test
View remote_config.yml
remote_var: "val"
@Gowiem
Gowiem / load-form-tree.js
Created Oct 31, 2017
A complicated model tree loading function
View load-form-tree.js
import Ember from 'ember';
import DS from 'ember-data';
const { RSVP } = Ember;
const { PromiseObject } = DS;
async function loadSections(form) {
return form.get('formSections');
}
@Gowiem
Gowiem / pagination-serializer.js
Last active Jun 6, 2017
Useful snippets to abstract out EmberIgniter's Rails JSONAPI + Pagination Example
View pagination-serializer.js
import Ember from 'ember';
export default Ember.Mixin.create({
normalizeQueryResponse(store, clazz, payload) {
const result = this._super(...arguments);
result.meta = result.meta || {};
if (payload.links) {
result.meta.pagination = this.createPageMeta(payload.links);
}
View devise_invitable_source.md

DeviseInvitable + Rails API + Ember

Intro

In a recent project, I put together Rails API backend and a Ember CLI frontend for one of my awesome clients. With Rails5, Devise, and Ember Simple Auth Devise it's a beaut of a project; Being both a pleasure to work in as well as being an environment which is highly productive. One tiny hill I had to run up while working on this project was using the DeviseInvitable (DV) plugin to create a email invite sign up flow for the app's users. DV adds some out of the box routes and a mailer to your application so you can simply call User.invite!(email: 'mike@saulgoodman.com') and it will create a user, assign them an invite token, and set them up so they can sign up via the email that it sends out.

In my project, I needed to make this system work with my Ember only frontend. This was a simple enough process but requir

View accept-invitation.hbs
{{!-- app/templates/accept-invitation.hbs --}}
{{#bs-form model=model onSubmit=(route-action "submit" model) as |f|}}
{{f.element controlType="password" label="Password" placeholder="Password" property="password" required=true}}
{{f.element controlType="password" label="Password Confirmation" placeholder="Password Confirmation" property="password_confirmation" required=true}}
{{bs-button defaultText="Submit" type="primary" buttonType="submit"}}
{{/bs-form}}