This file contains 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
#!/bin/bash | |
# First, configure the host to run VSCode with SSHCODE - https://github.com/cdr/sshcode | |
# Then, run this command via the command line exposed from the new VSCode window (assuming as Root) | |
# Inspired by https://github.com/evantahler/workstation | |
### | |
# Run Command: | |
# wget https://gist.githubusercontent.com/evantahler/ddfbe3101c3c9fe8451c6412e288c9fa/raw/85e544e513591f316ec23a482419e6e060431fac/setup.sh && chmod 0766 setup.sh && ./setup.sh | |
### |
This file contains 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
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set VPNService to the service "vpn-evan" -- replace this with the name of your VPN connection | |
if VPNService is not null then | |
if current configuration of VPNService is not connected then | |
beep | |
beep | |
beep | |
connect VPNService |
This file contains 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
// in your action | |
{formatter} = requrie('../helper.js') | |
// in helper.js | |
const path = require('path') | |
exports.formatter = require(path.join(__dirname, 'path', 'that', 'is', 'really', 'long', 'formatter.js')) |
This file contains 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
/** | |
* @jest-environment jest-environment-webdriver | |
*/ | |
const url = 'https://www.actionherojs.com' | |
describe('www.actionherojs.com#index', () => { | |
test('it renders', async () => { | |
await browser.get(url) | |
const title = await browser.findElement(by.tagName('h2')).getText() |
This file contains 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 nexe = require('nexe') | |
nexe.compile({ | |
output: 'build', | |
input: `${__dirname}/index.js`, | |
build: true, | |
silent: false | |
}) |
This file contains 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
require('isomorphic-fetch') // ensure fech is in-scope, even on the server | |
let hosts = { | |
dev: 'http://localhost:8080', | |
production: 'https://api.scoreboard.guru' | |
} | |
export default class Client { | |
apiEndpoint () { | |
if (process && process.title === 'node') { |
This file contains 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
exports.cacheTest = { | |
name: 'cacheTest', | |
description: 'I will test the internal cache functions of the API', | |
inputs: { | |
key: { | |
required: true, | |
formatter: function (s) { return String(s) } | |
}, | |
value: { | |
required: true, |
This file contains 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 {promisify} = require('util') | |
async sleep (time) { | |
return promisify(setTimeout)(time) | |
} |
This file contains 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
exports.api = {} | |
exports.initializer = require('./initializer.js') | |
exports.main = require('./main.js') // comment me out and everything is fine |
This file contains 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
#! /usr/bin/env node | |
// I am ./bin/buildSitemap.js | |
const path = require('path') | |
const glob = require('glob') | |
const fs = require('fs') | |
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |