Skip to content

Instantly share code, notes, and snippets.

View kenvontucky's full-sized avatar

João Gomes kenvontucky

View GitHub Profile
@kenvontucky
kenvontucky / gist:12de1419b7ee297906b1aba4c30409c7
Created September 29, 2025 10:20 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
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: [