Skip to content

Instantly share code, notes, and snippets.

View abiyasa's full-sized avatar

Abiyasa Suhardi abiyasa

View GitHub Profile
@abiyasa
abiyasa / inject-script.test.js
Last active February 14, 2018 10:35
NightWatch.js execute() and executeAsync() with input script as a string
/**
* Examples how to inject scripts on NightWatch.js test.
* The following test will open a page, inject & run the scripts, and get the results.
* The injected script will be run synchronously & asynchronously.
*
* Both examples use script as a string since I could not find any example on this.
* Normally, you have the input script as a JS function but there are cases where you
* have to load & inject external script (e.g third party library).
*/
module.exports = {
@abiyasa
abiyasa / backup-project.sh
Last active August 29, 2015 14:18
Script to backup a project folder to a 7Z file
#!/bin/bash
# Project to backup
PROJECT_NAME="myproject"
PROJECT_FOLDER="../works/myproject"
# Filename will be myproject-20150424.7z
NOW=$(date +"%Y%m%d")
FILE="$PROJECT_NAME-$NOW.7z"