Skip to content

Instantly share code, notes, and snippets.

Avatar

Oscar Nevarez oscarnevarezleal

View GitHub Profile
View getBuildpackName.go
func getBuildpackName(context packit.BuildContext) (string, error) {
var conf packit.BuildpackInfo
if _, err := toml.DecodeFile(filepath.Join(context.CNBPath, "buildpack.toml"), &conf); err != nil {
return "", err
}
return conf.Name, nil
}
@oscarnevarezleal
oscarnevarezleal / amplifyPush
Created Jul 12, 2021
This is the amplifyPush script
View amplifyPush
#!/usr/bin/env bash
set -e
IFS='|'
help_output() {
echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>"
echo " --environment The name of the Amplify environment to use"
echo " --simple Optional simple flag auto-includes stack info from env cache"
exit 1
}
init_env() {
@oscarnevarezleal
oscarnevarezleal / clean-up-cloudmap.sh
Created Feb 1, 2021
Clean up AWS Cloudmap Namespace
View clean-up-cloudmap.sh
# This cleans every cloudmap and every service
# from https://www.appmeshworkshop.com/cleanup/cloudmap/
NAMESPACE=$(aws servicediscovery list-namespaces | \
jq -r ' .Namespaces[] |
select ( .Properties.HttpProperties.HttpName == "appmeshworkshop.pvt.local" ) | .Id ');
SERVICE_ID=$(aws servicediscovery list-services --filters Name="NAMESPACE_ID",Values=$NAMESPACE,Condition="EQ" | jq -r ' .Services[] | [ .Id ] | @tsv ' )
aws servicediscovery list-instances --service-id $SERVICE_ID | jq -r ' .Instances[] | [ .Id ] | @tsv ' |\
while IFS=$'\t' read -r instanceId; do
@oscarnevarezleal
oscarnevarezleal / SimpleErrorController.java
Created Sep 20, 2019
SimpleErrorController.java for SpringBot v2.0
View SimpleErrorController.java
package com.app.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.WebRequest;
View db-stack.template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"efe6e8a5-83b8-44fe-9a93-c3ea86b57fe7": {
"size": {
"width": 60,
"height": 60
},
"position": {
View autoscaling-instance.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "",
"Parameters": {
"VPCCidrBlock": {
"Description": "Select CIDR Block for VPC",
"Type": "String",
"Default": "10.0.0.0/16"
},
"Subnet1Cidrblock": {
@oscarnevarezleal
oscarnevarezleal / .project
Created Sep 6, 2019
.project file for a SpringBoot Application (STS)
View .project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gs-accessing-data-jpa-complete</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
View TailWind Chat POC
<div class="w-full max-w-xs bg-white">
<div class="max-w-sm rounded overflow-hidden shadow-lg">
<div class="bg-scroll bg-top h-64 relative" style="background-image:url(https://pbs.twimg.com/profile_images/885868801232961537/b1F6H4KC_400x400.jpg);">
<span class="text-2xl absolute pin-b pin-r font-light text-right align-text-bottom text-white">
Jonathan Reinink
</span>
View Install php 7.1 missing extensions
sudo apt install php7.1-common php7.1-fpm php7.1-cli php7.1-json php7.1-mysql php7.1-curl php7.1-intl php7.1-mcrypt php-pear php7.1-gd php7.1-zip php7.1-xml php7.1-mbstring
View get docker first d
DOCKERID=$(docker ps --format "{{.ID}} {{.Command}}" | awk '{print $1 }')