Skip to content

Instantly share code, notes, and snippets.

View tamlyn's full-sized avatar

Tamlyn Rhodes tamlyn

View GitHub Profile
@tamlyn
tamlyn / cypress.test.js
Created March 8, 2018 11:16
Example Cypress test suite
// a very short Cypress test suite
describe('Admin user', () => {
it('Create posts journey', () => {
const postTitle = 'Hello testing'
cy.get('input[id=title]').type(postTitle)
cy.get('button[title=Create]').click()
cy.get('table tr:last label').should('contain', postTitle)
})
})
@tamlyn
tamlyn / scrape.js
Last active March 23, 2018 23:37
Scrape statements from First Direct internet banking
//////// CONFIG /////////
// your first direct user name
const username = ''
// your password (the one it asks for characters from)
const password = ''
// your memorable word
const memorable = ''
// set to false if you want to see the browser window as it runs
const headless = true
async function fact() {
const response = await fetch('https://catfact.ninja/fact')
const data = await response.json()
return data.fact
}
'use strict';
let fact = (() => {
var _ref = _asyncToGenerator(function* () {
const response = yield fetch('https://catfact.ninja/fact');
const data = yield response.json();
return data.fact;
});
return function fact() {
'use strict';
var fact = function () {
var _ref = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var response, data;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
@tamlyn
tamlyn / Barknet.ipynb
Created November 23, 2018 21:02
Error when training
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tamlyn
tamlyn / cartpole.ipynb
Last active December 22, 2020 08:54
OpenAI Gym CartPole-v1 with Pytorch 1.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function removeOrigin(dom) {
let origin = window.location.origin;
let $internalElements = dom.querySelectorAll(`[href^="${origin}"],[src^="${origin}"]`);
for (let $el of $internalElements) {
const attr = $el.hasAttribute('href') ? 'href' : 'src';
const value = $el.getAttribute(attr);
$el.setAttribute(attr, value.replace(origin, ''));
}
return dom
@tamlyn
tamlyn / Readme.md
Created May 20, 2020 09:33
Camunda

Issues with Camunda

It fails to deliver on its promise

The idea is nice:

  • You separate the business rules from the code.
  • You use a graphical language that non-developers can understand.
  • The developers then write adapters for the business process diagram to enact the business rules.
  • Non-developers can both see and edit the business flow at any time in response to changing business needs.
openapi: 3.0.0
info:
title: Test case
version: "1"
paths:
/users:
get:
responses:
"200":