Skip to content

Instantly share code, notes, and snippets.

View Mattchewone's full-sized avatar
:octocat:
Developing all the things

Matt Chaffe Mattchewone

:octocat:
Developing all the things
View GitHub Profile
deploy function:
stage: deploy
image: google/cloud-sdk:latest
script:
- cd $APP
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY
- gcloud config set project $GCLOUD_SERVICE_PROJECT
- gcloud functions deploy $APP --gen2 --runtime nodejs16 --entry-point $APP --trigger-http --region=europe-west1 --memory=2048 --timeout=10m --allow-unauthenticated
only:
- master
@Mattchewone
Mattchewone / machine.js
Last active November 13, 2020 10:02
Generated by XState Viz: https://xstate.js.org/viz
const trackMachine = Machine({
id: 'ai-sync',
initial: 'initial',
context: {
action: null,
retries: 0
},
states: {
initial: {
on: {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Mattchewone
Mattchewone / authentication.js
Created January 26, 2018 16:31 — forked from marshallswain/authentication.js
Example tools for using querystring redirects with Feathers OAuth login.
'use strict';
const authentication = require('feathers-authentication');
const jwt = require('feathers-authentication-jwt');
const local = require('feathers-authentication-local');
const oauth2 = require('feathers-authentication-oauth2');
const GithubStrategy = require('passport-github');
// Bring in the oauth-handler
const makeHandler = require('./oauth-handler');
@Mattchewone
Mattchewone / terminal-git-branch-name.md
Created September 6, 2018 15:50 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@Mattchewone
Mattchewone / media.model.js
Created February 22, 2018 19:48 — forked from RubyRubenstahl/media.model.js
Mongoose discriminators in feathers-cli generated service.
// media-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
module.exports = function (app) {
const mongooseClient = app.get('mongooseClient');
const { Schema } = mongooseClient;
const options = {
discriminatorKey: 'type',