Skip to content

Instantly share code, notes, and snippets.

View adambouchard's full-sized avatar

Adam Bouchard adambouchard

View GitHub Profile
describe('Authentication', () => {
it('Login - fail w/ incorrect credentials', () => {
cy.visit('/login')
cy.get('[data-cy=email]').type('sysadmin+e2e@easelearning.com')
cy.get('[data-cy=password]').type('wrongpwd123')
cy.get('[data-cy=submit]').click().then(() => {
cy.url().should('include', '/login')
cy.get('[data-cy=error]').should('be.visible')
})
})
@adambouchard
adambouchard / gist:1e265f780b451546a231d7b0ff76b84e
Created August 3, 2020 11:48
Hide the dropdown is-hoverable after a click event
<template>
<div class="dropdown is-hoverable" ref="dropdown">
<div class="dropdown-trigger" style="cursor:pointer">
<span v-html="getName()">Dropdown button</span>
<span class="icon is-small">
<i class="fas fa-angle-down" aria-hidden="true"></i>
</span>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu">
<div class="dropdown-content">
<template>
<div>
<button
@click="upload()"
class="button"
>
{{ label }}
</button>
<modal
v-if="showUploadModal"
const rubric = {
dimensions: [
{id: 1, text: "Writing Quality"},
{id: 2, text: "Description of Service Learning"},
{id: 3, text: "Insights and Understanding"},
{id: 4, text: "Committment & Challenge"}
],
criteria: [
{id: 1, text: "Excellent", points: 4},
{id: 2, text: "Very Good", points: 3},
import api from "api.js";
import jwt_decode from 'jwt-decode';
$(function(){
//Login Button
$('#btn-login').click(function() {
login()
}
export default {
get(page) {
return this.all().find(p => p.page == page)
},
all() {
return [
{
page: 'signup',
title: 'Sign up',
subtitle: 'Please enter your name, email and set a password.',
, {
"recipe" : {
"uri" : "http://www.edamam.com/ontologies/edamam.owl#recipe_95fa6f5689286a4ffab774da45192494",
"label" : "Thomato Chicken",
"image" : "https://www.edamam.com/web-img/561/56100df8491403ea215cea3c782faec9.jpg",
"source" : "BBC Good Food",
"url" : "http://www.bbcgoodfood.com/recipes/94602/thomato-chicken",
"shareAs" : "http://www.edamam.com/recipe/thomato-chicken-95fa6f5689286a4ffab774da45192494/chicken/alcohol-free/591-722-cal",
"yield" : 3.0,
"dietLabels" : [ "Low-Carb" ],
##MY OLD THINKING APPROACH
defmodule MathHelpers do
def average(values) do
unless Enum.empty?(values), do: Enum.sum(values) / Enum.count(values)
end
end
##PATTERN MATCHING APPROACH