Skip to content

Instantly share code, notes, and snippets.

View siddharthbarman's full-sized avatar

Siddharth Barman siddharthbarman

View GitHub Profile
@siddharthbarman
siddharthbarman / quotify.ps1
Created April 17, 2021 20:23
Create a quoted csv from a plain csv
import-csv input.csv | export-csv output.csv -NoTypeInformation -Encoding UTF8
@siddharthbarman
siddharthbarman / AppConfig.java
Created July 11, 2020 11:17
Configuring a rolling file log (logback) to create a log file every hour and splitting log files if they are more than 4 MB in size.
package com.sbytestream.sample;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.sbytestream.sample")
public class AppConfig {
}
@siddharthbarman
siddharthbarman / Application.java
Created July 11, 2020 08:38
Access application properties the classic way
package com.sbytestream.sample;
public class Application {
public static void main(String[] args) {
try {
ApplicationProperties applicationProperties = new ApplicationProperties();
System.out.println(applicationProperties.getSignatureFetchUrl());
}
catch(Exception e) {
System.out.println(e.getMessage());
@siddharthbarman
siddharthbarman / ProducerConsumerSample.java
Created July 2, 2020 16:48
A typical multi-threaded producer-consumer sample code.
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
public class ProducerConsumerSample {
public static void main(String[] args) {