Skip to content

Instantly share code, notes, and snippets.

View sudiptamondal's full-sized avatar
🏠
Working from home

Sudipta Mondal sudiptamondal

🏠
Working from home
  • New Delhi, India
View GitHub Profile
@sudiptamondal
sudiptamondal / sample_data_for_edq_proc.json
Created February 27, 2020 13:32
sample_data_for_edq_proc.json
{"base":"EUR","rates":{"CAD":1.4469,"HKD":8.4742,"ISK":139.3,"PHP":55.538,"DKK":7.471,"HUF":339.28,"CZK":25.344,"AUD":1.6565,"RON":4.805,"SEK":10.5813,"IDR":15221.86,"INR":77.9195,"BRL":4.7741,"RUB":71.2368,"HRK":7.4605,"JPY":120.13,"THB":34.664,"CHF":1.0606,"SGD":1.5204,"PLN":4.3094,"BGN":1.9558,"TRY":6.6981,"CNY":7.6329,"NOK":10.2113,"NZD":1.7273,"ZAR":16.4555,"USD":1.0875,"MXN":20.806,"ILS":3.7429,"GBP":0.8415,"KRW":1322.29,"MYR":4.5952}}
@sudiptamondal
sudiptamondal / sample_data_for_edq_proc.csvalues
Last active February 27, 2020 13:22
sample_data_for_edq_proc.csvalues
+--------+--------------+------------+-----------------+
| Value | Convert From | Convert To | Converted Value |
+--------+--------------+------------+-----------------+
| 100.14 | INR | USD | |
| 290.19 | INR | GBP | |
| 310.05 | INR | EUR | |
| 110.67 | INR | CAD | |
| 200 | EUR | EUR | |
| 10 | EUR | GBP | |
| 3 | EUR | INR | |
@sudiptamondal
sudiptamondal / read_json_in_macrocode.vb
Created February 25, 2020 14:12
Code snippet to loop through JSON data
Dim jsonObject As Object, item As Variant
Set jsonObject = JsonConverter.ParseJson(strResponse)
For Each item In jsonObject
'do something with json object
Next item
@sudiptamondal
sudiptamondal / GET_REQ_VIA_MACRO.vb
Created February 25, 2020 13:03
Code Snippet to send GET Request via function in Excel Macro
Private Sub FetchData()
Dim objRequest As Object, strUrl As String, blnAsync As Boolean, strResponse As String
Dim jsonObject As Object, item As Variant
Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "<URL_GOES_HERE>"
blnAsync = True
With objRequest
.Open "GET", strUrl, blnAsync
@sudiptamondal
sudiptamondal / read_sql_fetch_cols.rb
Created February 25, 2020 12:09
Code snippet to fetch column names between select and from keyword to analyse.
def analyse file_path
file = File.open(file_path, "r")
counter = 0 # counter for having a 2D Array
writefile = false
array = Array.new
file.readlines.each do |line|
if line.start_with? "SELECT"
writefile = true;
array[counter] = Array.new
end
@sudiptamondal
sudiptamondal / CreateNotif.java
Created February 10, 2020 07:24
CreateNotif.java-4
notificationManager.notify("1001", builder.build());
@sudiptamondal
sudiptamondal / CreateNotif.java
Created February 10, 2020 07:24
CreateNotif.java-3
final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
@sudiptamondal
sudiptamondal / CreateNotif.java
Created February 10, 2020 07:23
CreateNotif.java-2
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "1000111")
.setContentTitle("Notification Title")
.setSmallIcon(R.drawable.ic_stat_name)
.setContentText("Notification Text")
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
@sudiptamondal
sudiptamondal / CreateNotif.java
Created February 10, 2020 07:17
CreateNotif.java-1
private void createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel("1000111", "cld_notif_channel", NotificationManager.IMPORTANCE_DEFAULT);
channel.setDescription("cld_notif_desc");
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
}
@sudiptamondal
sudiptamondal / install_gem.sh
Last active December 19, 2015 12:09
MongoDB Class. Install mongo driver to connect with ruby source files. Part 1 - Install gem
# Steps
# 1. Install the gem mongo
gem install mongo
gem install bson_ext
# bson_ext is for optimal performance of using mongodb.
# You can still use mongo without it.
# But then, it will throw a warning.
# you you skip rdoc and ri using
# gem install mongo --no-rdoc --no-ri