Skip to content

Instantly share code, notes, and snippets.

View DineshSolanki's full-sized avatar
:octocat:
Looking for java roles

Dinesh Solanki DineshSolanki

:octocat:
Looking for java roles
View GitHub Profile
@DineshSolanki
DineshSolanki / UpdateMultipleSVN.bat
Created March 16, 2022 10:06
Update multiple svn folders with batch file
REM originally found here - https://medium.com/tinywave/svn-automatic-update-using-batch-file-9eaf78f226b9
set CHECKOUTFOLDER=D:\folder1*D:\folder2
set SVNPATH=C:\Program Files\TortoiseSVN\bin
"%SVNPATH%\TortoiseProc.exe" /command:update /path:"%CHECKOUTFOLDER%" /closeonend:2
@DineshSolanki
DineshSolanki / treat_http_as_secured.txt
Created March 24, 2022 05:15
Testing features that need HTTPS
To test features on any domain that needs HTTPS (Secured) connection -
enable these settings -
for chrome -go to chrome://flags/#unsafely-treat-insecure-origin-as-secure ->then enter domain and enable it
for firefox - go to about:config ->then enable -> media.getusermedia.insecure.enabled
@DineshSolanki
DineshSolanki / remove_ansi.sh
Last active March 22, 2023 13:57
remove ansi escape code from log files
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" input_file > output_file
(Get-Content input_file) -replace "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "" | Set-Content output_file
@DineshSolanki
DineshSolanki / remove_ansi.ps1
Created March 22, 2023 14:11
remove ansi escape codes from log files
# Get input path from user
$path = Read-Host "Enter file or folder path"
# Check if input path is a file or folder
if (Test-Path $path -PathType Leaf) {
# If path is a file, process it and save output to 'Cleaned' subdirectory
$outputPath = Join-Path (Split-Path $path) "Cleaned"
New-Item -ItemType Directory -Path $outputPath -Force
(Get-Content $path -Raw) -replace "\x1B\[[0-9;]*[mK]" | Set-Content (Join-Path $outputPath (Split-Path $path -Leaf))
} elseif (Test-Path $path -PathType Container) {
public static void showProgressWithETA(int current, int total, long startTime) {
long elapsedTimeMillis = System.currentTimeMillis() - startTime;
int percent = current * 100 / total;
int progress = percent / 2;
System.out.print("\r[");
for (int i = 0; i < progress; i++) {
System.out.print("\u001b[32m=\u001b[0m");
}
for (int i = progress; i < 50; i++) {
System.out.print(" ");

IntelliJ IDEA Cheatsheet 💡

Navigation 🌐

  • Ctrl + N - Go to class 🏫
  • Ctrl + Shift + N - Go to file 📄
  • Ctrl + Alt + Shift + N - Go to symbol ♾️
  • Ctrl + B / Ctrl + Click - Go to declaration 📜
  • Ctrl + Alt + B - Go to implementation(s) 👷
@DineshSolanki
DineshSolanki / svn2Git.md
Created September 6, 2023 12:45
SVN 2 GIT

Here is a visually appealing guide for migrating from SVN to Git:

Migrate SVN to Git

1. Generate authors file

Navigate to SVN repo directory:

cd /path/to/svn/repo
@DineshSolanki
DineshSolanki / migrateToFoliconv4.ps1
Last active February 14, 2024 16:59
FoliCon v4.0 uses different naming scheme of icon names, therefore deletion of old files or manual rename is necessary
function Rename-FolderIcons {
param(
[string]$folderPath,
[int]$depth = 0
)
$subDirectories = Get-ChildItem -Path $folderPath -Directory
$totalDirs = $subDirectories.Count
@DineshSolanki
DineshSolanki / newToken.pm
Created March 11, 2024 12:01
generate and set new token variable if postman request fails with 401
if (pm.response.code === 401) {
pm.sendRequest({
url: 'https://YOUR-KEYCLOAK-SERVER/realms/REALM-NAME/protocol/openid-connect/token',
method: 'POST',
header: 'Content-Type:application/x-www-form-urlencoded',
body: {
mode: 'urlencoded',
urlencoded: [
{key: "grant_type", value: "client_credentials"},
{key: "client_id", value: "YOUR CLIENT ID"},
@DineshSolanki
DineshSolanki / regex.regex
Last active April 4, 2024 12:27
intellij issue navigation regex
(fix|task|Task|bug|Bug|feature|Feature)(_| |:|: |-|- | - | : )#?(\d+)