Skip to content

Instantly share code, notes, and snippets.

View anvilation's full-sized avatar
🤖
Workie workie

Matthew Barben anvilation

🤖
Workie workie
View GitHub Profile
import { request } from 'urllib';
import * as https from 'https';
import * as http from 'http';
const httpsAgent = new https.Agent({ keepAlive: true });
const agent = new http.Agent({ keepAlive: true });
export class OTRestAPI {
user: string;
pass: string;
csurl: string;
import { request } from 'urllib';
export class OTRestAPI {
user: string;
pass: string;
csurl: string;
otdsurl: string;
ticket: string | null = null;
constructor(user: string, pass: string, csurl: string, otdsurl: string) {
@anvilation
anvilation / businessrequest-interim.js
Last active August 31, 2021 06:51
You Might not need WebReoprts: When to use WebReports
window.addEventListener('DOMContentLoaded', () => {
try {
main();
} catch (error) {
console.error(error);
}
});
async function main() {
// Constants
@anvilation
anvilation / logger.js
Last active August 30, 2021 12:19
Smart UI: Creating a Logger for a widget
define(function () {
var logger = {
mode: 'DEBUG',
appname:'Driver Lane Logger',
loglevel: 1,
config: function(mode, appname){
this.mode = mode;
this.appname = appname;
this.loglevel = this.logLevelNumber(this.mode) || 10;
},
@anvilation
anvilation / azurepipeline.yaml
Created May 26, 2021 09:26
Smart UI CI / CD - Add build task to pipeline
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
@anvilation
anvilation / test-app.js
Created May 25, 2021 00:44
Smart UI CI / CD - Re-written Test Spect
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
const os = require('os');
describe('csui-extension generator', function () {
this.timeout(0);
let options = {
skipInstall: true,
}
@anvilation
anvilation / index.js
Last active August 30, 2021 12:20
Smart UI CI / CD - Re-written Yeoman Widget Generator
const chalk = require('chalk');
const esprima = require('esprima');
const escodegen = require('escodegen');
const superb = require('superb');
const yosay = require('yosay');
const _ = require('../shared/lodash-complete');
const Generator = require('yeoman-generator');
-_.extend(Generator.prototype, require('yeoman-generator/lib/actions/install'));
const promptDefaults = {
"widgetDirectory": "hello",
@anvilation
anvilation / index.js
Last active August 30, 2021 12:20
Smart UI CI / CD - Re-written Yeoman Smart UI Module Generator
const chalk = require('chalk');
const superb = require('superb');
const yosay = require('yosay');
const _ = require('../shared/lodash-complete');
const Generator = require('yeoman-generator');
-_.extend(Generator.prototype, require('yeoman-generator/lib/actions/install'));
const promptDefaults = {
"projectName": "driverlane",
"projectDescription": "driverlane e2e test module",
"modulePrefix": "drive"
@anvilation
anvilation / azurepipeline.yaml
Last active August 30, 2021 12:20
Smart UI CI / CD - Extend pipeline to run yeoman builds
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
@anvilation
anvilation / csui-extension-widget.json
Created May 21, 2021 05:22
Smart UI CI / CD Yeoman Widget Answers
{
"answers": {
"widgetDirectory": "hello",
"widgetClassPrefix": "Hello",
"widgetCssClass": "-hello",
"widgetTitle":"Hello",
"widgetDescription":"Simple Widget for the widgets",
"widgetBundle":"drive-all"
},
"options": {