View stack-lib.ts
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
import { join } from "path"; | |
import { fileURLToPath } from "url"; | |
import type { Construct } from "constructs"; | |
import { Duration, Stack, StackProps } from "aws-cdk-lib"; | |
import { LogLevel, NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs"; | |
import { Runtime } from "aws-cdk-lib/aws-lambda"; | |
import { Rule, Schedule } from "aws-cdk-lib/aws-events"; | |
import { LambdaFunction } from "aws-cdk-lib/aws-events-targets"; | |
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam"; |
View generateCommonColumns.ts
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
import { Schema } as GlueSchema from '@aws-cdk/aws-glue'; | |
/** | |
* Create a parquet columns and Glue table columns from a common object | |
* @param attributes { name: type } | |
* @returns { | |
* parquetSchema: { name: { type: 'type' }, ...}, | |
* glueSchema: [ | |
* { name: 'name', type: 'UTF8' }, | |
* ... |
View req.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
const { Agent } = require("https"), | |
request = require("request"); | |
const FINGERPRINTSET = [ | |
"C3:07:56:2C:08:A5:E1:2E:41:20:10:7A:02:87:86:C3:72:49:45:BF", | |
]; | |
const req = request( | |
{ | |
url: "https://www.duckduckgo.com/", |
View Paginator.ts
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
/** | |
* Paginates over a AWS service function. | |
* @param functionToExec The function to execute | |
* @param methodToExec The method to execute | |
* @param params The parameters to pass to the method | |
* @param keyToAppend The key to append to the result | |
* @returns A promise that resolves to an array of results | |
*/ | |
export async function paginator( | |
functionToExec: any, |
View addUser.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
exports.handler = async (event, context, callback) => { | |
const | |
baseJFrogURL = 'https://yourorg.jfrog.io/artifactory', | |
request = event.Records[0].cf.request, | |
body = request.body; | |
switch (body.action) { | |
case 'added': | |
const orgEmailAddress = useJeffUserQueryHere(body.member.login) // Your place to shine! | |
const payload = { |
View webhook.py
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
import logging | |
logger = logging.getLogger(__name__) | |
def report(saved_object): | |
""" | |
report is the main function in reporter | |
# :param uid: django ORM unique identifier; for internal usage. |
View view.py
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
import logging | |
from json import loads | |
from django.apps import apps | |
from django.core.exceptions import FieldDoesNotExist, FieldError | |
from django.core.serializers import serialize | |
from django.http import JsonResponse | |
logger = logging.getLogger(__name__) |
View .fetchRemoteConf.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
require('dotenv').config() | |
const admin = require("firebase-admin"); | |
admin.initializeApp({ | |
credential: admin.credential.cert( | |
process.env.NODE_ENV === 'production' | |
? require('./gcp.json') | |
: JSON.parse(process.env.FIREBASE_ADMIN_SDK) | |
), | |
databaseURL: process.env.FIREBASE_DATABASE_URL | |
}); |
View express_server_obj_exposed_to_firebase.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
const server = require(`./src/server`); | |
process.env.NODE_ENV === "DEV" ? | |
/** | |
* If dev environment, run express server for local debugging. | |
*/ | |
server.listen(process.env.PORT || 3000) : | |
/** | |
* Creates a function instance and with a specific specs. |
View server.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
module.exports = (() => { | |
/** | |
* Map all available handlers to express route. | |
* @type {{handler}|*} | |
*/ | |
const fs = require('fs'); | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const bunyan = require('bunyan'); |
NewerOlder