Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduardo Rabelo oieduardorabelo

View GitHub Profile
@oieduardorabelo
oieduardorabelo / template-database.yaml
Created Feb 28, 2021
Network and Database Layers Teample
View template-database.yaml
#
# Creates one RDS PostgreSQL instance and RDS Proxy
# with connections allowed in ports 443 and 5432
#
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: "Database Layer"
@oieduardorabelo
oieduardorabelo / .env.example
Created Feb 24, 2021
Sample of Cognito with Server-Sider Authentication
View .env.example
PORT=xxx
COGNITO_USER_POOL_ID=xxx
COGNITO_CLIENT_ID=xxx
COOKIE_SESSION_SECRET=xxx
COOKIE_SESSION_NAME=xxx
AWS_REGION=xxx
AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=xxx
View acloudguru-filter.js
$$('[ng-if="vm.isCompleted"]').forEach(el => { el.parentNode.parentNode.parentNode.removeChild(el.parentNode.parentNode) })
@oieduardorabelo
oieduardorabelo / help-samsung-internet.md
Last active Aug 15, 2019
Looking for help about Samsung Internet vs others browsers in PWA manifest.json
View help-samsung-internet.md

hello pwa gurus!

we've this app deployed, with https, everything is working as expected, except the manifest in Samsung Internet only,

app link: https://app.zbarista.co.nz/

we are testing in multiple devices and android versions (tablets, oreo, samsung s7, pixel, etc) and it happens every time, only in Sasmsung Internet, even after a fresh install of the app in Android.

any idea what might be happening here?

@oieduardorabelo
oieduardorabelo / basic-example-accordion-rtg.tsx
Created Mar 17, 2019
`react-transition-group/Transition` example
View basic-example-accordion-rtg.tsx
import React from "react";
import Transition from "react-transition-group/Transition";
const duration = 300;
const Accordion = ({ in: inProp, children }) => {
const childrenType = typeof children.type;
if (childrenType === "undefined" || childrenType === "symbol") {
throw new Error(
View relay-inspired-pagination.js
const mockData = require("./mock-data.json");
const resolvers = {
Query: {
courses: (parent, args, context) => {
let edges = mockData;
let first = args.first;
let after = args.after;
let before = args.before;
View recursive-file-rename.js
const fs = require('fs');
const cp = require('child_process');
const testFolder = './src';
function getFiles(dir, files_ = []) {
const files = fs.readdirSync(dir);
Object.values(files).forEach((fileName) => {
const name = `${dir}/${fileName}`;
View redux-middleware-user-timing.js
const userTiming = () => (next) => (action) => {
if (performance.mark === undefined) return next(action);
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(
`${action.type}`,
`${action.type}_start`,
`${action.type}_end`,
);
View callMethodWithArgs.ts
// ts 3.x
// https://stackoverflow.com/questions/54129289/typescript-call-a-member-of-an-object-with-arguments
let fns = {
set: (foo: string, bar: string) => {
return { foo, bar };
}
};
function callMethodWithArgs<
FnsObj extends { [key in MethodKey]: (...args: any[]) => any },