Skip to content

Instantly share code, notes, and snippets.

View DMeechan's full-sized avatar
🧑‍🌾
Building stuff

Daniel Meechan DMeechan

🧑‍🌾
Building stuff
View GitHub Profile
@DMeechan
DMeechan / mocha-third-test-case.js
Created June 18, 2018 15:16
DevOps Course Chapter 8 - Automated testing
it('contains DevOps course task', async function() {
try {
const expectedValue = "Finish DevOps course";
const matchingTasks = await driver.findElements(By.css(`li[value="${expectedValue}"]`));
matchingTasks.length.should.equal(1);
} catch (error) {
throw new Error(error);
}
});
@DMeechan
DMeechan / mocha-second-test-case.js
Created June 18, 2018 15:16
DevOps Course Chapter 8 - Automated testing
it('lists four tasks', async function() {
try {
const list = await driver.findElements(By.tagName("li"));
list.length.should.equal(4);
} catch (error) {
throw new Error(error);
}
});
@DMeechan
DMeechan / mocha-first-test-case.js
Created June 18, 2018 15:15
DevOps Course Chapter 8 - Automated testing
it('is correct', async function() {
try {
const expectedTitle = 'Example To Do List';
const title = await driver.getTitle();
title.should.equal(expectedTitle);
} catch (error) {
throw new Error(error);
}
});
@DMeechan
DMeechan / mocha-simple-example.js
Created June 18, 2018 15:14
DevOps Course Chapter 8 - Automated testing
describe("string length", function() {
it('should return number of characters in a string', function() {
"Hello".length.should.equal(5)
});
});
@DMeechan
DMeechan / mocha-real-life-example.js
Last active June 18, 2018 15:14
DevOps Course Chapter 8 - Automated testing
describe('earth', function() {
describe('united kingdom', function() {
it('should have at least 70% rain', function() {
// Code for determining if there is enough rain
});
});
describe('australia', function() {
it('should have at least 80% sunshine', function() {
@DMeechan
DMeechan / playbook-complete.yml
Last active July 27, 2018 12:55
DevOps Course Chapter 2 - Ansible
---
- hosts: mygroup
become: yes
become_method: sudo
vars:
NODEJS_VERSION: "10"
ansible_become_pass: devops
gecko_version: 0.17.0
selenium_install_firefox: yes
@DMeechan
DMeechan / playbook-tasks.yml
Last active July 26, 2018 15:12
DevOps Course Chapter 2 - Ansible
---
- hosts: mygroup
become: yes
become_method: sudo
vars:
NODEJS_VERSION: "10"
ansible_become_pass: devops
gecko_version: 0.17.0
@DMeechan
DMeechan / fix-libcudart-tensorflow-error.md
Last active May 15, 2018 08:12
Quick and easy way to fix the libcudart.so.8.0 error in TensorFlow

Quick and easy way to fix the libcudart.so.8.0 error in TensorFlow

The error message this fixes:

ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

Run the command below:

sudo ldconfig /usr/local/cuda/lib64

@DMeechan
DMeechan / deploy.sh
Last active February 20, 2018 14:17
IBM Cloud Meteor 1.6 Deploy Script
#!/bin/bash
# See guide here:
# https://gist.github.com/DMeechan/25469e18ea9fde342540752002a17d64
indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";; # mac/bsd sed: -l buffers on line boundaries
*) sed -u "$c";; # unix/gnu sed: -u unbuffered (arbitrary) chunks of data
@DMeechan
DMeechan / build.sh
Last active February 20, 2018 14:10
IBM Cloud Meteor 1.6 Build Script
#!/bin/bash
# See guide here:
# https://gist.github.com/DMeechan/25469e18ea9fde342540752002a17d64
METEOR_HOME=.meteor/local
PATH=$METEOR_HOME/usr/bin:$METEOR_HOME/usr/lib/meteor/bin:$PATH
indent() {
c='s/^/ /'