Skip to content

Instantly share code, notes, and snippets.

View jplew's full-sized avatar

JP Lew jplew

View GitHub Profile
@jplew
jplew / server.js
Last active July 29, 2018 06:37
Entry point to NodeJS Oxford API
const yargs = require('yargs')
const query = yargs.argv
const env = getEnv(query.env)
function getEnv(env) {
if (env === 'dev') {
return ''
} else if (env) {
return '.env.' + env
} else {
@jplew
jplew / index.js
Created July 29, 2018 06:15
Routes exporter (routes/index.js)
const initWordbankRoutes = require('./wordRoutes.js')
const initOxfordRoutes = require('./oxfordRoutes.js')
module.exports = function(app, db) {
initWordbankRoutes(app, db)
initOxfordRoutes(app)
return app
}
@jplew
jplew / fakeDataHelpers.js
Created August 23, 2018 22:52
helper functions to create fake dates
/**
* @author: JP Lew (jp@hackcapital.com)
* @date: Monday, 23rd July 2018 5:14:39 pm
* @lastModifiedBy: JP Lew (jp@hackcapital.com)
* @lastModifiedTime: Thursday, 23rd August 2018 1:03:37 pm
* project: Share Results
* @copyright (c) 2018 Hack Capital
*/
const randomNumber = (min = 0, max = 10) => Math.floor(Math.random() * max) + min;
[2018-10-11 12:39:17.023] [exthost] [info] extension host started
[2018-10-11 12:39:17.074] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"activationEvent":"*"}
[2018-10-11 12:39:17.074] [exthost] [info] ExtensionService#loadCommonJSModule /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/debug-auto-launch/dist/extension
[2018-10-11 12:39:17.088] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"activationEvent":"*"}
[2018-10-11 12:39:17.088] [exthost] [info] ExtensionService#loadCommonJSModule /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/emmet/dist/extension
[2018-10-11 12:39:17.149] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"activationEvent":"*"}
[2018-10-11 12:39:17.149] [exthost] [info] ExtensionService#loadCommonJSModule /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main
[2018-10-11 12:39:17.270] [exth
@jplew
jplew / index.js
Last active May 17, 2019 22:47
Run an op from a gist
#!/usr/bin/env node
const boxen = require("boxen")
const logo = `
██████╗ ████████╗ ██████╗  █████╗ ██╗
██╔════╝ ╚══██╔══╝ ██╔═══██╗ ██╔══██╗ ██║
██║   ██║  ██║ ██║ ███████║ ██║
██║   ██║  ██║ ██║ ██╔══██║ ██║
Process: Oni2_editor [82168]
Path: /Applications/Onivim2.App/*/Oni2_editor
Identifier: com.outrunlabs.onivim2
Version: 0.01
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Oni2_editor [82168]
User ID: 501
Date/Time: 2019-07-31 16:29:17.857 -0700
@jplew
jplew / README.md
Created October 21, 2019 02:58
Github README

🛠 CTO.ai Github Ops 🚀

A collection of ops to manage your Github workflow

Requirements 🔑

  • Create Github access token

    • You would need the Github access token in order to run any Github command. Find the steps to create the access token here.
@jplew
jplew / README.md
Created October 21, 2019 02:59
AWS README

🛠 CTO.ai AWS CLI Scaffold OP 🚀

A user-friendly interactive command line user interface to build and run an AWS CLI command.

Requirements

Here's what you'll need before running this op:

  • AWS Access Key Id: Generate via AWS Management Console > Security Credentials > Access Keys
  • AWS Access Key Secret: Generate via AWS Management Console > Security Credentials > Access Keys
@jplew
jplew / welcome.html
Last active October 21, 2019 19:09
Updated Welcome Page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Signed up - CTO.ai</title>
<link
rel="shortcut icon"
type="image/png"
@jplew
jplew / welcome-back.html
Created October 21, 2019 19:17
Welcome Back page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Signed in - CTO.ai</title>
<link
rel="shortcut icon"
type="image/png"