Skip to content

Instantly share code, notes, and snippets.

@jeshan
jeshan / cdk-profile-plugin.js
Last active April 28, 2022 20:01
How to select AWS profiles per account in AWS CDK
const { CredentialProviderChain } = require('aws-sdk');
const AWS = require('aws-sdk');
const accountProvider = require('./account-provider');
let getEnv = function(accountId) {
// TODO: insert logic to get your desired profile name
return profileName;
};
let getProvider = async (accountId, mode) => {
@biniama
biniama / SwaggerDocConfig.java
Last active March 12, 2020 15:28
Swagger Documentation with Spring Boot (working UI)
package com.example.springbootswagger.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
import springfox.documentation.builders.ApiInfoBuilder;
@joseluisq
joseluisq / stash_dropped.md
Last active May 23, 2024 14:45
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@JefStat
JefStat / sumo_logic.config
Last active September 25, 2020 21:15
Elastic Beanstalk Sumo Logic Config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# To add or remove tracked files, simply add or remove source hashes to the
# sources array.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
sysvinit:
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
public static class TaskTupleExtensions
{
#region (Task<T1>)
public static TaskAwaiter<T1> GetAwaiter<T1>(this ValueTuple<Task<T1>> tasks)
{
@paulmillr
paulmillr / grunt.js
Last active April 26, 2016 14:31
Gulp / grunt
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
@cheeaun
cheeaun / js-error-logging-services.md
Last active December 10, 2023 13:04
JavaScript error logging services