Skip to content

Instantly share code, notes, and snippets.

View mudassaralichouhan's full-sized avatar
:octocat:
It’s not a bug; it’s an undocumented feature.

Mudassar Ali mudassaralichouhan

:octocat:
It’s not a bug; it’s an undocumented feature.
View GitHub Profile
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
echo "Resetting trial period for $product"
echo "removing evaluation key..."
rm -rf ~/.config/$product*/eval
# Above path not working on latest version. Fixed below
rm -rf ~/.config/JetBrains/$product*/eval
echo "removing all evlsprt properties in options.xml..."
@mudassaralichouhan
mudassaralichouhan / preview.js
Created November 28, 2022 10:00
display selected image
<script>
document.querySelectorAll('input[type="file"]').forEach((el, index) => {
el.onchange = e => {
const file = e.target.files[0];
if ( file ) {
el.closest('div[class*="col-md"]')
.querySelector('img').src = URL.createObjectURL(file);
}
}
});
@mudassaralichouhan
mudassaralichouhan / dynamic-element-create.js
Last active November 24, 2022 04:49
let clonedMenu = menu.cloneNode(true)
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title>JavaScript cloneNode() Demo</title>
</head>
<body>
<ul id="menu">
<li>Home</li>
<li>Services</li>
window.addEventListener("DOMContentLoaded", () => {
// DOM ready! Images, frames, and other subresources are still downloading.
var myModal = new bootstrap.Modal(document.getElementById('exampleModal'))
myModal.toggle()
});
@mudassaralichouhan
mudassaralichouhan / detecting-image-404.html
Created November 2, 2022 18:13
Detecting an image 404 in Javascript
<img src="{{ $vendor->image }}" onerror="ImgError(this)">
<script type="text/javascript">
function ImgError(source){
source.src = 'http://bbb.test/assets/images/placeholder.png';
source.onerror = "";
return true;
}
</script>