Skip to content

Instantly share code, notes, and snippets.

View kenvontucky's full-sized avatar

João Gomes kenvontucky

View GitHub Profile
from dynamo.base import DynamoBase
from samples.log.schema import TABLE_NAME, TIMESTAMP, STATUS, INDEX_STATUS_KEY
class DynamoLog(DynamoBase):
def get_params(self, key):
params = {
'TableName': TABLE_NAME,
'Key': {
from dynamo.base import DynamoBase
from samples.domain.schema import TABLE_NAME, DOMAIN, URL
class DynamoDomain(DynamoBase):
def get_params(self, key):
params = {
'TableName': TABLE_NAME,
'Key': {
@kenvontucky
kenvontucky / dynamodb_base.py
Created March 2, 2020 22:33
DynamoDB base
import sys
from abc import abstractmethod
import boto3
class DynamoBase:
def __init__(self, conf):
self.conf = {
TABLE_NAME = 'Log'
TIMESTAMP = 'updated_at'
STATUS = 'status'
INDEX_STATUS_KEY = 'Status'
SCHEMA = {
'TableName': TABLE_NAME,
'AttributeDefinitions': [
{
'AttributeName': TIMESTAMP,
'AttributeType': 'S'
@kenvontucky
kenvontucky / domain_key_value_dynamodb_table_schema.py
Last active March 2, 2020 17:10
domain keyvalue dynamodb table schema
TABLE_NAME = 'Domain'
DOMAIN = 'domain'
URL = 'url'
SCHEMA = {
'TableName': TABLE_NAME,
'AttributeDefinitions': [
{
'AttributeName': URL,
'AttributeType': 'S'
}
@kenvontucky
kenvontucky / .gitlab-ci.yml
Created September 28, 2018 13:29
gitlab ci cd google app engine manual deploy
image: node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
stages:
- test
- build
@kenvontucky
kenvontucky / app.yaml
Last active September 28, 2018 20:56
google app engine
# [START runtime]
runtime: nodejs8
handlers:
- url: /
static_files: dist/demo-app/index.html
upload: dist/demo-app/index.html
- url: /
static_dir: dist/demo-app
# [END runtime]
@kenvontucky
kenvontucky / protractor.conf.js
Created September 24, 2018 22:02
angular e2e puppeteer headless chrome
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
@kenvontucky
kenvontucky / karma.conf.js
Created September 24, 2018 21:58
karma puppeteer headless chrome
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
@kenvontucky
kenvontucky / .gitlab-ci.yml
Created September 24, 2018 21:10
Gitlab CI for Angular 6 project
image: node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
before_script:
- apt-get update && apt-get install -y unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
- npm install --silent