This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpResponse, HttpClient } from '@angular/common/http'; | |
| import { Observable, of, throwError, timer } from 'rxjs'; | |
| import { mergeMap } from 'rxjs/operators'; | |
| const interceptedUrls = [ | |
| {regex: /\/loans$/, method: 'GET', filename: 'summary.json', returnStatusCode: 200}, | |
| {regex: /\/loans\/\d+$/, method: 'GET', filename: 'detail.json', returnStatusCode: 200} | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You must activate Bigquery in Services: https://developers.google.com/apps-script/advanced/bigquery | |
| const startRow = 1; | |
| const startCol = 1; | |
| const projectId = "gcp-projectId"; | |
| const datasetId = "dataset"; | |
| const writeDispositionSetting = "WRITE_TRUNCATE"; | |
| const sheetName = 'sheetName'; | |
| const tableId = "bq_table"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Thanks to: https://github.com/GoogleCloudPlatform/cloud-builders/issues/376#issuecomment-594094378 | |
| steps: | |
| # Runs postgresql | |
| - name: gcr.io/cloud-builders/docker | |
| id: boot-postgres | |
| args: [ 'run', '-d', '--publish=5432:5432', '--env=POSTGRES_PASSWORD=postgres', '--network=cloudbuild', '--name=postgres', 'postgres:9.6-alpine', '-N', '500' ] | |
| waitFor: [ '-' ] | |
| # Wait until postgresql is available | |
| - name: jwilder/dockerize:0.6.1 | |
| id: await-postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GCPHandler(logging.StreamHandler): | |
| def emit(self, record): | |
| try: | |
| msg = self.format(record) | |
| stream = self.stream | |
| trace = None | |
| global_log_fields = {} | |
| if request and 'X-Cloud-Trace-Context' in request.headers.keys() and GCP_PROJECT: | |
| trace_header = request.headers.get("X-Cloud-Trace-Context") | |
| trace = trace_header.split("/")[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {google} from 'googleapis'; | |
| const gcsPath = process.env.TEMPLATE_GCS_PATH; | |
| const projectId = process.env.GCP_PROJECT; | |
| const numWorkers = process.env.NUM_WORKERS || 1; | |
| const location = 'us-central1'; | |
| const zone = 'us-central1-a'; | |
| const runner = 'DataflowRunner'; | |
| const dataflowApiVersion = 'v1b3'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect | |
| set timeout 10 | |
| log_user 0 | |
| send_user "desconectando si es que hay alguna sesion abierta\n" | |
| spawn snx -d | |
| expect { | |
| timeout { exit 2 } | |
| eof { | |
| sleep 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.math.BigDecimal; | |
| import java.text.DateFormat; | |
| import java.text.NumberFormat; | |
| import java.text.ParseException; | |
| import java.util.Calendar; | |
| import java.util.Date; | |
| import java.util.Locale; | |
| /** | |
| * Clase con ejemplos para imprimir números y fechas en formato Chileno |