Skip to content

Instantly share code, notes, and snippets.

View bodrulamin's full-sized avatar
:octocat:
Focusing

Bodrul Amin bodrulamin

:octocat:
Focusing
View GitHub Profile
sudo apt install --install-recommends winetricks
sudo winetricks --self-update
winetricks -q dotnet45
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
package com.example;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
@bodrulamin
bodrulamin / web.xml
Last active November 16, 2021 13:45
Built in CorsFilter for tomcat server
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>http://localhost:4200</param-value>
</init-param>
<init-param>
@bodrulamin
bodrulamin / usb bootable-dd command
Created October 11, 2021 10:27
replace sdX to according to your pendrive/flashdrive partition. replace /input/iso/file.iso according to you iso file path
sudo dd of=/dev/sdX bs=1M status=progress oflag=sync if=/input/iso/file.iso
@bodrulamin
bodrulamin / 90-bn.conf
Last active March 22, 2023 20:46
Manjaro xfce bengali font Problem solve. copy this file to (if directory not exist create one) ~/.config/fontconfig/conf.d/90-bn.conf
<fontconfig>
<match target="pattern">
<test name="lang" compare="contains">
<string>bn</string>
</test>
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans Bengali</string>
@bodrulamin
bodrulamin / ffmpeg.md
Created September 23, 2021 02:41 — forked from smilingmiao/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@bodrulamin
bodrulamin / clean_code.md
Created September 23, 2021 02:34 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

# works on Version 2021.2.2 or below
cd ~
sudo rm .config/JetBrains/**/options/other.xml
sudo rm -rf .config/JetBrains/**/eval/*
sudo rm -rf .java/.userPrefs
public static int[] bubbleSort(int[] list) {
boolean needNextPass = true;
for (int i = 1; i < list.length && needNextPass; i++) {
needNextPass = false;
for (int j = 0; j < list.length - i; j++) {
if (list[j] > list[j + 1]) {
int big = list[j];
list[j] = list[j + 1];
list[j + 1] = big;
needNextPass = true;