Skip to content

Instantly share code, notes, and snippets.

View andreafalzetti's full-sized avatar

Andrea Falzetti andreafalzetti

View GitHub Profile
@andreafalzetti
andreafalzetti / azzard.pas
Last active September 15, 2024 11:34
azzard.pas
{***** INTESTAZIONE *****}
{***** Autore: Rex Romae *****}
Program Azzard1;
uses crt;
{***** VARIABILI *****}
VAR inizio:string[255];
risposta,uscita:char;
scelta,puntata,numero,numero2,I,estratto,estratto2,colore,colores:integer;
flag,flag2,estratti,estratti2:boolean;
services:
movies:
image: okteto/movies-with-compose:proxy
ports:
- 80:80
depends_on:
- api
- frontend
@andreafalzetti
andreafalzetti / error-with-stracktrace.go
Created October 13, 2022 16:07
How to get the stacktrace of an errror in Go
package main
import (
"errors"
"fmt"
go_errors "github.com/go-errors/errors"
)
func main() {
apiVersion: backstage.io/v1beta2
kind: Template
# some metadata about the template itself
metadata:
name: v1beta2-demo
title: Test Action template
description: scaffolder v1beta2 template demo
spec:
owner: backstage/techdocs-core
type: service
const http = require('http');
const https = require('https');
const AWSXRay = require('aws-xray-sdk-core');
const AWS = AWSXRay.captureAWS(require('aws-sdk'));
const needle = require('needle');
AWSXRay.captureHTTPsGlobal(http);
AWSXRay.captureHTTPsGlobal(https);
const fetchUserDetails = (username, segment) => {
@andreafalzetti
andreafalzetti / lingoder.js
Created June 1, 2019 22:25
Lingoda Teaching Material Downloader in Node.js
/**
* Node.js Script to Download Lingoda Teaching Material
*/
const fs = require('fs');
const needle = require('needle');
const { promisify } = require('util');
const { stringify } = require('query-string');
const mkdir = require('mkdirp-promise');
const writeFileAsync = promisify(fs.writeFile);
const PerformanceProfiler = () => {
const performance = {};
const start = metricName => {
if (!performance[metricName]) {
performance[metricName] = {};
}
performance[metricName].startAt = process.hrtime();
};
@andreafalzetti
andreafalzetti / s3bucket-to-tar
Last active September 5, 2018 14:20
Simple bash script to download and bundle an s3 bucket
#!/usr/bin/env bash
# Simple bash script to download and bundle an s3 bucket
# Usage:
# AWS_PROFILE=... S3_BUCKET_NAME=... ./s3bucket-to-tar
# Requires:
# aws cli, tar
set -euo pipefail
@andreafalzetti
andreafalzetti / clean_node_modules.sh
Created June 18, 2018 09:58
Delete all node_modules recursively
find . -name "nodemodules" -type d -prune -exec rm -rf '{}' +
@andreafalzetti
andreafalzetti / create-url-parameter.sh
Created June 14, 2018 13:47
Creates a URL parameter in AWS SSM
#!/usr/bin/env bash
set -eu -o pipefail
# Usage:
# ./create-url-parameter /dev/projectName/API_BASE_URL https://api.example.com
name="$1"
value="$2"
description="$3"