Skip to content

Instantly share code, notes, and snippets.

View arlina-espinoza's full-sized avatar

Arlina Espinoza Rhoton arlina-espinoza

View GitHub Profile
@arlina-espinoza
arlina-espinoza / save_file.php
Last active August 24, 2023 20:27
Drupal 9-10: Save dynamically generated files
<?php
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Serialization\Yaml;
function saveFileDirectly($data) {
$encoded = Yaml::encode($data);
$filename = 'public://my_dir/my_file.yaml';
// Get the folder for the final location of this style.
openapi: 3.0.3
info:
version: 1.0.0
title: Support for different security types
description: Forked from https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securitySchemeObject
servers:
- url: https://httpbin.org
tags:
- name: API Key
- name: HTTP
function remove-docker-containers
echo "Stop running shit"
docker stop (docker ps -q)
echo "Remove the whale shit"
docker rm (docker ps -a -q)
end
function remove-docker-images
remove-docker-containers
@arlina-espinoza
arlina-espinoza / composer.json
Last active September 15, 2020 20:15
Drupal 9 - Project template for Apigee Edge testing
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 9 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
@arlina-espinoza
arlina-espinoza / hybrid-edge-testing.md
Last active November 8, 2019 16:41
Apigee Edge Hybrid testing

How to Install Apigee Edge for testing Hybrid integration

  1. Install Drupal using composer:
composer create-project drupal-composer/drupal-project:8.x-dev MY_PROJECT --no-interaction
cd MY_PROJECT
  1. Edit the composer.json file. The "repositories" section should look like:
@arlina-espinoza
arlina-espinoza / split_json.sh
Created May 24, 2017 21:29
Bash script to split a JSON into multiple files. Uses jq.
#!/bin/bash
# Split a JSON into multiple files. Uses jq.
# Usage
# ./split_json.sh /path/to/json/file
file="$1"
jq -cr 'keys[] as $k | "\($k)\t\(.[$k])"' "$file" | awk -F\\t '{ file=$1".json"; print $2 > file; close(file); }'

Keybase proof

I hereby claim:

  • I am arlina-espinoza on github.
  • I am arlina (https://keybase.io/arlina) on keybase.
  • I have a public key ASDzcXlRjKnZUEMyHJ267PaSll-rlSxEzo5-69fz9ezj7go

To claim this, I am signing this object:

@arlina-espinoza
arlina-espinoza / filtrar_datos_por_lat_y_long.sh
Last active August 29, 2015 14:22
Linux script: Filtrar por latitud y longitud un conjunto de datos utilizando el programa "NCO" (NetCDF operators - http://nco.sourceforge.net).
#!/bin/bash
# Instrucciones:
# 1. Descargar el script, actualizar las variables y guardar.
# 2. Desde consola, dar permisos de ejecución al script:
# chmod u+x filtrar_datos_por_lat_y_long.sh
# 3. Ejecutar el script desde consola:
# ./filtrar_datos_por_lat_y_long.sh
@arlina-espinoza
arlina-espinoza / filtrar_datos_por_lat_y_long.bat
Last active August 29, 2015 14:02
Filtrar por latitud y longitud un conjunto de datos utilizando el programa "NCO" (NetCDF operators - http://nco.sourceforge.net).
@echo off
REM Cambiar las siguientes variables con los directorios de los datos,
REM donde desean guardar los archivos procesados, y el directorio donde se encuentra el programa NCO.
REM Nota importante: Los nombres de archivos y directorios no deben contener espacios!
SET data_dir=E:\MISRdata\MISR_DATA
SET processed_dir=E:\MISRdata\procesados
SET nco_dir=C:\nco
SET lat_ini=18.0
SET lat_fin=23.0