Skip to content

Instantly share code, notes, and snippets.

View gregbown's full-sized avatar

Gregory Bown gregbown

View GitHub Profile
@gregbown
gregbown / Axis Generated Class .java
Last active March 17, 2023 19:43
Axis wsdl2java Java code generation from .wsdl
/**
* Address.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4.1-SNAPSHOT Mar 11, 2019 (00:47:30 UTC) WSDL2Java emitter.
*/
package com.projectname.webservice.generated;
public class Address implements java.io.Serializable {
@gregbown
gregbown / 1)-initial-papyrus-view-no-project.jpg
Last active July 3, 2022 06:04
Importing spring framework - spring state machine sample UML into Papyrus
1)-initial-papyrus-view-no-project.jpg
@gregbown
gregbown / verify_dns.sh
Created July 14, 2021 04:31
verify domain DNS
openssl s_client -showcerts -connect daybreakgames.com:443
@gregbown
gregbown / routes.js
Last active July 22, 2020 00:19
Test login flow with CSRF token using Mocha, Chai, and Supertest
const assert = require('chai').assert;
const cookiejar = require('cookiejar');
const injector = require('../di-injector');
const testAccounts = require('../data/accounts.json');
const grabToken = new RegExp(/value=[a-zA-Z0-9\-_"]*(?= name="_csrf")/);
let agentFactory;
/** If you are using the tdd interface, suiteSetup maps to beforeAll, and setup maps to beforeEach. */
suite('routes', () => {
@gregbown
gregbown / express-app.js
Last active December 27, 2019 21:15
i18next server AND client side setup with express
/* Note: Just enough to get the idea here.
resources/
|- locales/
|- en/
|- translation.json
|- zh/
|- translation.json
|- static/
|- css/
|- fonts/
@gregbown
gregbown / client-form-rws.js
Created November 11, 2019 18:22
How to use csurf with multipart/form-data example with express, express-fileupload, csurf and jquery + a bit of bootstrap and ejs
/* Form AJAX JavaScript. Requires jQurery to be loaded */
window.DEMO = window.DEMO || {};
/**
* @method rws
* @description RESTful Web services (RWS)
* Wrapped in an IIFE (Immediately Invoked Function Expression)
* @paraam $ {object} jQuery object, used for ajax methods.
*/
// eslint-disable-next-line no-undef
@gregbown
gregbown / .clang-format
Created August 28, 2018 16:39
Local clang format for typescript
Language: JavaScript
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
@gregbown
gregbown / .clang-format
Created April 24, 2018 18:37
Clang format YAML file for local overrides in TypeScript
Language: JavaScript
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
@gregbown
gregbown / pagination-control.component.html
Created September 27, 2017 16:28
i18n components with multiple instances
<div class="form-group row-select">
<label for="rowDropdownMenu" i18n="the title for pagination results@@controlPaginationResults">Results per page</label>
<div ngbDropdown class="d-inline-block">
<button class="btn btn-outline-primary" id="rowDropdownMenu" ngbDropdownToggle>{{rows.current.text}}</button>
<div class="dropdown-menu" aria-labelledby="rowDropdownMenu">
<ng-template ngFor let-option [ngForOf]="rows.options | displays">
<button
class="dropdown-item"
value="{{option.value}}"
(click)="changed.emit({value:option.value, bubbles: true})">{{option.text}}</button>