Skip to content

Instantly share code, notes, and snippets.

Tamlyn Rhodes tamlyn

Block or report user

Report or block tamlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tamlyn / cartpole.ipynb
Last active Mar 22, 2020
OpenAI Gym CartPole-v1 with Pytorch 1.0
View cartpole.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View percy-dom-transformation.js
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 /
Last active Jul 26, 2019
Execution order of Jest/Jasmine test code

Execution order of Jest/Jasmine test code

While tests run in source order, surrounding code does not which can lead to hard to debug issues.

Compare the test file below with the sample output below that and note the order of the log messages.

Key points

  • Any code not inside of it, beforeAll, afterAll, beforeEach or afterEach runs immediately on initialisation.
    • This means code at the end of your file runs before even your before hooks.
tamlyn / .profile
Last active Dec 10, 2018
Configs for our command line tools
View .profile
# Use nano instead of vim
# always list in long format
alias ls='ls -la --color'
# set dynamic prompt and window/tab title
PS1='\[\e]0;${PWD##*/}\a\]\n' # set window title
#PS1="$PS1"'\u@\h ' # user@host<space>
PS1="$PS1"'\[\033[32m\]' # change color
tamlyn / Barknet.ipynb
Created Nov 23, 2018
Error when training
View Barknet.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View example.es5.js
'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 = {
case 0: = 2;
View example.es2015.js
'use strict';
let fact = (() => {
var _ref = _asyncToGenerator(function* () {
const response = yield fetch('');
const data = yield response.json();
return data.fact;
return function fact() {
View example.es2017.js
async function fact() {
const response = await fetch('')
const data = await response.json()
return data.fact
tamlyn / scrape.js
Last active Mar 23, 2018
Scrape statements from First Direct internet banking
View scrape.js
//////// 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
tamlyn /
Last active Mar 14, 2018
Start debugging a running node process

Shows a list of all node processes and lets you select which one you want to debug.

For example

1) 73428 node webpack/webpackDevServer.js
2) 73494 node build/dist/server.js
Select which process to debug: █
You can’t perform that action at this time.