Notable example of Dependency Injection and use of FileTransports discussed in awilix issues
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
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | |
function set( | |
obj: Record<string, any>, | |
path: string[] | string, | |
value: unknown, | |
): void { | |
if (typeof path === 'string') { | |
path = path.split(/[\.\[\]]/).filter(Boolean); | |
} |
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
class HawkExperiment | |
{ | |
async getEndpoint(request: Request, params: any) | |
{ | |
// headers = array of key value pairs extracted from headers | |
let headers: {[p: string]: string} = {} | |
request.headers.forEach((val, key, allHeaders) => { | |
headers[key] = val | |
}) | |
return Response.json({ |
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 { assign, createMachine, interpret } = require('xstate'); | |
const { inspect } = require('util'); | |
const queueMachine = createMachine({ | |
id: 'queueMachine', | |
initial: 'idle', | |
context: { | |
invokes: [], | |
processing: {}, | |
results: [] |
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
class DisposableStack { | |
constructor() { | |
if (!(this instanceof DisposableStack)) { | |
throw new TypeError('DisposableStack must be constructed with new'); | |
} | |
this.#state = 'pending'; | |
this.#disposeCapability = newDisposeCapability(); | |
} | |
get disposed() { |
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
var crypto = require('crypto'); | |
const id = process.env.API_ID; // your API ID, reading from environment variable | |
const key = process.env.KEY; // your API key, reading from environment variable | |
const preFix = "VERACODE-HMAC-SHA-256"; | |
const verStr = "vcode_request_version_1"; | |
var resthost = "api.veracode.com"; // rest host | |
var xmlhost = "analysiscenter.veracode.com"; // xml host |
You use this script passing:
- as first argument the input file
- second argument is the content code
You can get your activation_bytes or content code from this site:
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
class PageObject: | |
def __init__(self, driver): | |
self.driver = driver | |
def takeScreenshot(self): | |
# Código para tomar una captura de pantalla | |
pass | |
def checkTitle(self, expectedTitle): | |
self.takeScreenshot() |
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
DELIMITER $$ | |
CREATE PROCEDURE fixVersionAggregate () | |
BEGIN | |
DECLARE finished INTEGER DEFAULT 0; | |
DECLARE evId BIGINT DEFAULT 0; | |
DECLARE evVersion INT DEFAULT 0; | |
-- declare cursor for | |
DEClARE curEvent | |
CURSOR FOR |
NewerOlder