This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define coins | |
(list (cons 25 'quarter) | |
(cons 10 'dime) | |
(cons 5 'nickel) | |
(cons 1 'penny))) | |
(define (make-change cents) | |
(if (= cents 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
q: .string "QUARTER" | |
n: .string "NICKEL" | |
d: .string "DIME" | |
p: .string "PENNY" | |
f: .string "%s, " | |
fai: .string "FAILURE" | |
el: .string "\n" | |
pts: .quad q, d, n, p, 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const COINS = { | |
25: 'QUARTER', | |
10: 'DIME', | |
5: 'NICKEL', | |
1: 'PENNY' | |
}; | |
const COIN_VALUES = Object.keys(COINS).sort((a, b) => b - a); | |
class LL { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class Tree { | |
left = null; | |
right = null; | |
value = null; | |
constructor(v, l = null, r = null) { | |
this.value = v; | |
this.left = l; | |
this.right = r; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('this one succeeds', () => { | |
cy.visit('https://sso.local.domain:8443/'); | |
cy.intercept({ | |
method: 'POST', | |
url: 'https://sso.local.domain:8443/' | |
}, cookieFixer); | |
cy.get('#username').type('username'); | |
cy.get('#password').type('password'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('SSO login test', () => { | |
it('this one fails', () => { | |
cy.visit('https://sso.local.domain:8443/'); | |
cy.get('#username').type('username'); | |
cy.get('#password').type('password'); | |
cy.get('#submit').click(); | |
cy.location('pathname').should('include', 'callback'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sso = require('./sso'); | |
const mfa = require('./mfa'); | |
mfa(() => { | |
console.log('MFA listening...'); | |
sso(() => { | |
console.log('SSO listening...'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(() => { | |
window.location.assign(window.redirect); | |
}, 3000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
script window.redirect = "#{redirect}"; | |
script | |
include ../public/js/mfa.js | |
body Doing MFA things... |