Skip to content

Instantly share code, notes, and snippets.

View joshuataylor's full-sized avatar
👋

Josh Taylor joshuataylor

👋
View GitHub Profile
@joshuataylor
joshuataylor / test_parser.py
Created October 22, 2020 10:57
Parse dbt errors in github actions to display in github annotations
import json
import re
# Open the run_results.json, which contains results from the run or test run.
input_file = open('target/run_results.json')
json_array = json.load(input_file)
# If there is no errors, by default we just print a new line.
errors = "\n"
for item in json_array["results"]:
# Run and test have different syntaxes, this should cover them both.
So you have setup your API to accept CORS requests on certain paths on your API using [cors_plug](https://github.com/mschae/cors_plug) or [corsica](https://github.com/whatyouhide/corsica) and you are wondering how you test this with ExUnit.
## Back to basics: Does the endpoint actually work?
Well the first thing to do is to check if your endpoint is actually working with CORS.
You can do this via cURL:
curl http://localhost:4000/api/posts -v -H "Origin: https://example.com"
foreach (var item in items)
{
var message = new Foobar();
tasks.Add(context.Publish(message));
}
await Task.WhenAll(tasks).ConfigureAwait(false);
@joshuataylor
joshuataylor / app.js
Created October 23, 2017 12:31
Preact component to notify user when a change has been made, and on route change reload the page.
import { h, Component } from 'preact';
import { Router } from 'preact-router';
import Header from './header';
import Home from '../routes/home';
import Profile from '../routes/profile';
import NotifyChange from "./NotifyChange/index";
// import Home from 'async!../routes/home';
// import Profile from 'async!../routes/profile';
steps:
- checkout
- restore_cache:
keys:
- project-{{ checksum "mix.exs" }}-{{ checksum "mix.lock" }}
- run:
name: deps
command: MIX_ENV=test mix deps.get
- run:
name: compile test
def create(conn, %{"grant_type" => "password",
"username" => username,
"password" => password}) do
try do
user = User
|> where(username: ^username)
|> where(active: true)
|> Repo.one!
cond do
@joshuataylor
joshuataylor / controllers.application.js
Created February 2, 2017 14:08 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({
<html>
<style>
body {
background-color: #000;
}
h1 {
text-align: center;
color: #fff;
left: 0;
line-height: 200px;
From 0b2c3c5507bd7b068cf827cee23bfe14fc4d616f Mon Sep 17 00:00:00 2001
Message-Id: <0b2c3c5507bd7b068cf827cee23bfe14fc4d616f.1461217761.git.joshuataylorx@gmail.com>
From: Josh Taylor <[email protected]>
Date: Thu, 21 Apr 2016 15:49:15 +1000
Subject: [PATCH] Add ability to merge remote composer configurations via http
---
README.md | 5 +-
src/Merge/ExtraPackage.php | 134 +++++++++++++--------
src/MergePlugin.php | 56 +++++++--

Keybase proof

I hereby claim:

  • I am joshuataylor on github.
  • I am joshtaylor (https://keybase.io/joshtaylor) on keybase.
  • I have a public key ASATsm875vJ9BFeZk_xNAvxkovouvULF-TkIgOUnjsGxFQo

To claim this, I am signing this object: