Skip to content

Instantly share code, notes, and snippets.

View elstr's full-sized avatar
🍕
Working from home

Eleonora Lester elstr

🍕
Working from home
  • Buenos Aires
View GitHub Profile
@elstr
elstr / dev.yml
Created December 9, 2021 18:06 — forked from maxkostinevich/dev.yml
Github Actions - Deploy Serverless Framework (AWS)
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
@elstr
elstr / truncate.sql
Created October 1, 2021 14:28
truncate all tables postgres
CREATE OR REPLACE FUNCTION truncate_tables(username IN VARCHAR) RETURNS void AS $$
DECLARE
statements CURSOR FOR
SELECT tablename FROM pg_tables
WHERE tableowner = username AND schemaname = 'public';
BEGIN
FOR stmt IN statements LOOP
EXECUTE 'TRUNCATE TABLE ' || quote_ident(stmt.tablename) || ' CASCADE;';
END LOOP;
END;
@elstr
elstr / elasticache.yml
Created August 18, 2021 20:25
Elasticache Serverless
service: palabra-event-tracker
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: 20201221
profile: pruebas
timeout: 30 # API Gateway is limited to 30 seconds
region: ${opt:region, 'us-west-2'}
stage: ${opt:stage, 'qa'}
@elstr
elstr / elasticache.yml
Created August 17, 2021 19:54
Elasticache serverless configuration
service: palabra-event-tracker
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: 20201221
profile: palabra
timeout: 30 # API Gateway is limited to 30 seconds
region: ${opt:region, 'us-west-2'}
stage: ${opt:stage, 'qa'}
@elstr
elstr / bindings.xml
Created May 12, 2021 13:20
all key bindings vscode
<keymap name="Visual Studio" parent="$default" version="1" disable-mnemonics="false">
<action id="StepOut">
<keyboard-shortcut first-keystroke="shift F11"/>
</action>
<action id="Resume">
<keyboard-shortcut first-keystroke="F5"/>
</action>
<action id="EvaluateExpression">
<keyboard-shortcut first-keystroke="shift F9"/>
</action>
@elstr
elstr / Visual Studio Code - Mac.xml
Created May 12, 2021 13:16 — forked from alankyshum/Visual Studio Code - Mac.xml
Visual Studio Code (Mac) Keymap Settings for Android Studio/ Intellij
<keymap version="1" name="Visual Studio Code" parent="Visual Studio">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta c" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta x" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="meta v" />
</action>
@elstr
elstr / DOCKER-INTRO.md
Last active February 1, 2021 12:36
Docker

Docker 101

We will use the hello.txt file for the example echo "Hello from container" > hello.txt

Map directory to container (aka copy local dir to container dir)

docker run -v $(pwd):/app alpine cmd-to-exec

In detail

@elstr
elstr / hof.js
Created February 1, 2021 10:43
Higher Order Function Examples
// higher order function
// es una funcion que acepta una funcion como parametro
// puede o no retornar otra funcion
// pure => dado un valor x siempre me devuelve un valor y
function multiplicarPor(factor){
return function(valor) {
return valor * factor
}
@elstr
elstr / pruebas-go.go
Created September 4, 2020 21:39
pruebas-go
package main
import (
"fmt"
"time"
)
func main() {
t := time.Now()
fmt.Println(t)
@elstr
elstr / wait-groups.go
Created September 4, 2020 21:39
wait-group
package main
import "sync"
func main() {
// Definir un mutex
var mu sync.Mutex
// Wait groups
var wg sync.WaitGroup