Skip to content

Instantly share code, notes, and snippets.

View rselva's full-sized avatar

Selva rselva

  • 11:38 (UTC +05:30)
View GitHub Profile
@rselva
rselva / main.tf
Last active November 5, 2024 10:34
bucket_with_two_notification
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.74.0"
}
}
}
provider "aws" {
@rselva
rselva / keyword_arguments.rb
Last active February 23, 2024 17:52
Keyword arguements, long parameters, objects instead of primitive types
irb(main):012:1* def upsert(terminal_id:, slug:, value:)
irb(main):013:1* pp terminal_id
irb(main):014:1* pp slug
irb(main):015:1* pp value
irb(main):016:0> end
=> :upsert
irb(main):023:0> params = ActionController::Parameters.new({terminal_id:'12345678', slug:'name', value:'Lynx'} )
=> #<ActionController::Parameters {"terminal_id"=>"12345678", "slug"=>"name", "value"=>"Lynx"} permitted: false>
package com.amazonaws.samples;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.BasicSessionCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.Bucket;

Preparations for todays Docker workshop

Bring up Windows PowerShell # It is assumed you have Docker for Windows installed

Docker installation

PS:> docker version
--> Should show both server and client details

Download the following images

Part-8.

Part-9. Spring boot RESTFul application

Part-10. Hubot (Slack bot) (Example)

Part-1. Getting started - Docker environment

Docker CLI

docker [resource/object] [command] [options] [args]

Display Docker version and info

1. $ docker --version
2. $ docker version

To enable auto activation of content assit

Go to:

Window >> Preferences >> Java >> Editor >> Content Assist >> Auto activation triggers for java,
and enter .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 

this will trigger the auto activation for class names, methods, etc...

@rselva
rselva / LogDemoApplication.java
Last active November 7, 2017 17:07
Logback sample
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Levels: ERROR >> WARN >> INFO >> DEBUG >> TRACE
*/
public class LogDemoApplication {
private static final Logger logger = LoggerFactory.getLogger(PcsBatchApplication.class);
public static void main(String[] args) {