We will use the hello.txt file for the example
echo "Hello from container" > hello.txt
docker run -v $(pwd):/app alpine cmd-to-exec
| # | |
| # 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/ | |
| # |
| 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; |
| 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'} |
| 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'} |
| <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> |
| <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> |
| // 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 | |
| } |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| t := time.Now() | |
| fmt.Println(t) |
| package main | |
| import "sync" | |
| func main() { | |
| // Definir un mutex | |
| var mu sync.Mutex | |
| // Wait groups | |
| var wg sync.WaitGroup |