Skip to content

Instantly share code, notes, and snippets.

View Akhi1's full-sized avatar
🎯
Next big thing

Akhil Akhi1

🎯
Next big thing
View GitHub Profile
@Akhi1
Akhi1 / XcopyExcludeNode_Modules.md
Last active August 15, 2021 16:45
If you are on windows10 and want to copy files/folders to another location but also want to exclude certain folders from the source copy location
XCOPY G:\FOLDER1\react-workspace D:\FOLDER2\react-workspace /s /EXCLUDE:avoid.txt

avoid.txt should include the files or folders you want to exclude. In my case, I added node_modules in my avoid.txt

Reference: https://www.lifewire.com/xcopy-command-2618103

@Akhi1
Akhi1 / MuleCustomPolicy_settings.xml
Last active December 6, 2020 19:03
add a server with anypoint cloud platform credentials and a profile for archetype-repo in you .m2 > settings.xml file before publishing custom policy
<servers>
<server>
<id>exchange-server</id>
<username>anypoint_username</username>
<password>anypoint_password</password>
</server>
</servers>
<profiles>
@Akhi1
Akhi1 / KafkaServerExecutionInWindows.txt
Created September 3, 2020 15:26
Steps to run Kafka in a Windows PC along with Creating a Topic, Publishing to and Consuming a Topic and Deleting logs
Original Documentation for download and steps:
https://kafka.apache.org/quickstart
Download latest version of kafka server:
https://www.apache.org/dyn/closer.cgi?path=/kafka/
==================================================
Download and extract kafka to any directory (mine is installed in C:\kafka)
Open command prompt from within this folder ('kafka' in my case)
@Akhi1
Akhi1 / CorsFilterBean.java
Last active September 7, 2020 12:01
Bean for Springboot application that will configure CORS -Sometimes you might need to GET the json code generated in swagger to parse
// Append this code to the main class
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
// Allow anyone and anything access. Probably ok for Swagger spec
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("*");
@Akhi1
Akhi1 / studentdata.json
Created May 29, 2020 09:05
data used for today's session and you will need this for assignment project
[
{
"department":"cse",
"section":"A",
"studentid":"cs101",
"studentname":"george",
"personalinfo":[
{
"place":"delhi",
"food":"idli",
@Akhi1
Akhi1 / AutoMobileVerification.js
Last active November 30, 2019 16:21
You can run this code on chrome console and it will automatically fill the verification code and clicks the verify button until the webpage accepts one
// 1. Go to the chrome console
// 2. Paste this below code and press enter
var i=1000;
function verifyMOBI() {
// data to execute
document.getElementById("ENTER THE INPUT BOX ID").value = i;
document.getElementById("ENTER THE VERIFY BUTTON ID").click();
i++;
}
@Akhi1
Akhi1 / Trucaller-chromebookmark.txt
Last active November 14, 2017 02:50
You can create a truecaller bookmark on your chrome and search mobile numbers in a single click on the go
1. Go to chrome bookmarks bar
2. Add new page and add the following credentials for Name and Url inputs
3. Name : <any name you desire>
4. Url : javascript:function tcaller(){ var mobile_num = window.prompt("Please enter the mobile number you want to search for"); if(mobile_num!=null && mobile_num!=""){ var search_num = window.open("https://www.truecaller.com/search/in/"+mobile_num) } else { var search_num = console.log("Please enter a valid number") } } tcaller();
5. You can update the above code and add you country code like shown below
window.open("https://www.truecaller.com/search/<YOUR COUNTRY CODE>/"+mobile_num
6. Try it!