the man who blames other, has long way in journey to go,
the man who blames himself, half way there,
the man who blames no one, has arrived.
Disable/Enable Spotlight in Mac OS with Terminal
Disabling Spotlight in MacOS is pretty easy, launch the Terminal and type the following command:
sudo mdutil -a -i off
This tells the Spotlight manager to disable all indexing on all volumes, the command will require your administrative password to execute.
Re-enabling Spotlight in MacOS is just as easy, just reverse the command to:
sudo mdutil -a -i on
Now Spotlight indexing will be back on and work as usual.
How to encode and decode HTML entities with JavaScript
In JavaScript, decoding and encoding HTML entities is a common task when dealing with user-generated content or manipulating strings. These functions can be used to encode and decode HTML entities as there is no built-in method in JavaScript. It’s essential for securing and properly displaying user input in web applications.
Decode HTML-entities
function decodeHTMLEntities(text) {
var textArea = document.createElement('textarea');
textArea.innerHTML = text;
return textArea.value;
}
Decode HTML-entities (JQuery)
function decodeHTMLEntities(text) {
return $("<textarea/>")
.html(text)
.text();
}
Encode HTML-entities
function encodeHTMLEntities(text) {
var textArea = document.createElement('textarea');
textArea.innerText = text;
return textArea.innerHTML;
}
Encode HTML-entities (JQuery)
function encodeHTMLEntities(text) {
return $("<textarea/>")
.text(text)
.html();
}
পাল পাল
পাল পাল তারপে জিস পাল কে লিয়ে,
ও পালভি আয়া কুছ পাল কে লিয়ে,
শোচা উস পালকো রোকলু হার পাল কে লিয়ে,
পার ও পালভি ঠেহারা কুচ পাল কে লিয়ে,
Increase Your Apple Magic Mouse Speed
Increasing the magic mouse speed is incredibly simple using just a few Terminal commands. Here is exactly what you need to do:
- Open Terminal (Applications > Utilities > Terminal)
- Type this command to see your current mouse speed setting:
defaults read .GlobalPreferences com.apple.mouse.scaling
or
defaults read -g com.apple.mouse.scaling
- To increase the speed, enter a new scaling value like so. The default is 3 – try something between 4-12:
defaults write .GlobalPreferences com.apple.mouse.scaling 8
or
defaults write -g com.apple.mouse.scaling 5
- When ready, quit Terminal and reboot your Mac for the new setting to take effect.
That’s all there is to it! Once your system boots back up, you’ll instantly notice how much faster and more responsive your mouse movement is.
The reason this works is it overrides the default scaling value set by Apple. They configure the Magic Mouse Speed out of the box to be slower than the maximum speed allowed in System Preferences. But with this quick terminal command, you can boost it well beyond the standard limit.
Create folder and file from string on MacOS
tell application "Finder"
display dialog "File Name:" default answer ""
set fileNameWithPath to the text returned of result
if length of fileNameWithPath = 0 then
return 0
end if
set thisFolder to the target of the front window as alias
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
set myFolderFileList to every text item of fileNameWithPath
set AppleScript's text item delimiters to oldDelimiters
set fileName to the last item of myFolderFileList -- get last item
if length of myFolderFileList > 1 then
set myFolderList to myFolderFileList's (items 1 thru -2) --remove last item
repeat with folderName in myFolderList
if length of folderName > 0 then
if (exists folder folderName of thisFolder) is true then
set newThisFolder to thisFolder & folderName as text
set thisFolder to newThisFolder as alias
else
set thisFolder to make new folder with properties {name:folderName} at thisFolder
end if
end if
end repeat
end if
if length of fileName > 0 then
make new file at thisFolder with properties {name:fileName}
end if
end tell
Keno Ei Nishongota
কেন এই নিঃসঙ্গতা
পার্থ বড়ুয়া – সোলস
কেন এই নিঃস্বঙ্গতা,
কেন এই মৌনতা
আমাকে ঘিরে
কেউ না জানুক কার কারণে,
কেউ না জানুক কার স্মরণে
কোন পিছুটানে
তবুও জীবন যাচ্ছে কেটে
জীবনের নিয়মে।
স্বপ্নগুলো অন্য কারো, ভূল গুলো আমারই
কান্নাগুলো থাক দুচোখে, কষ্ট আমারই
ভেবে নেব প্রেমালে আজ আঁধারি।
কেউ না জানুক কোন বিরহে
দিন চলে যায় আজ কিভাবে,
কোন পিছুটানে
তবুও জীবন যাচ্ছে কেটে
জীবনের নিয়মে।
ইচ্ছেগুলো থাক হৃদয়ে, ব্যর্থতা আমারই
সুখ নাহোক অন্য কারো, দুঃখরা আমারই
ভুলে যাবো মন কেন আজ ফেরারী।
কেউ না জানুক কোন হতাশায়
দিন চলে যায় নীরবে হায়,
কোন পিছুটানে
তবুও জীবন যাচ্ছে কেটে
জীবনের নিয়মে।
Protected: Shopify Show Color Variants on Collection Page
AI Tools
Everyone’s talking about #ChatGPT. But 90% of you are missing out on the AI revolution. Here are the top AI tools you NEED to know about.
- Krisp: Krisp’s AI removes background voices, noises, and echo from your calls, giving you peace of call
Link: https://krisp.ai/ - Beatoven: Create unique royalty-free music that elevates your story
Link: https://www.beatoven.ai/ - Cleanvoice: Automatically edit your podcast episodes
Link: https://cleanvoice.ai/ - Podcastle: Studio quality recording, right from your computer
Link: https://podcastle.ai/ - Flair: Design branded content in a flash
Link: https://flair.ai/ - Illustroke: Create killer vector images from text prompts
Link: https://illustroke.com/ - Patterned: Generate the exact patterns you need for and design
Link: https://www.patterned.ai/ - Stockimg: Generate the perfect stock photo you need, every time
Link: https://stockimg.ai/ - Copy: AI Generated copy, that actually increases conversion
Link:https://www.copy.ai/ - CopyMonkey: Create Amazon listings in seconds
Link: http://copymonkey.ai/ - Ocoya: Create and schedule social media content 10x faster
Link: https://www.ocoya.com/ - Unbounce Smart Copy: Write high-performing cold emails at scale
Link: https://unbounce.com/ - Vidyo: Make short-form vids from long-form content in just a few clicks
Link: https://vidyo.ai/ - Maverick: Generate personalized videos at scale
Link:https://lnkd.in/dmrkz_ah - Quickchat: AI chatbots that automate customer service charts
Link: https://www.quickchat.ai/ - Puzzle: Build an AI-powered knowledge base for your team and customers
Link: https://www.puzzlelabs.ai/ - Soundraw: Stop searching for the song you need. Create it.
Link: https://soundraw.io/ - Cleanup: Remove any wanted object, defect, people, or text from your pictures in seconds
Link: https://cleanup.pictures/ - Resumeworded: Improve your resume and LinkedIn profile
Link: https://lnkd.in/d9EurcnX - Looka: Design your own beautiful brand
Link: https://looka.com/ - theresanaiforthat: Comprehensive database of AIs available for every task
Link: https://lnkd.in/dKhqaaF3 - Synthesia: Create AI videos by simply typing in text.
Link: https://www.synthesia.io/ - descript: New way to make video and podcasts
Link: https://lnkd.in/d_Kdj35E - Otter: Capture and share insights from your meetings
Link: https://otter.ai/ - Inkforall: AI content (Generation, Optimization, Performance)
Link: https://inkforall.com/
Credit: MK Bertulfo
Vanilla JavaScript Ajax
JavaScript AJAX (Asynchronous JavaScript and XML) is a technique that gives the ability to send and receive data asynchronously from a web server. AJAX allows you to create rich, responsive user interfaces. It makes it easy to update data on the page without having to reload the entire page. It makes your application more responsive and user-friendly.
I’m going to show you two different ways to make an Ajax request.
1. Using XMLHttpRequest object:
XMLHttpRequest
(also known as XHR) object. This object is built into most browsers (even in Internet Explorer) and allows you to send requests and receive responses without having to reload the page.
Get request:
// Create the XMLHttpRequest object.
const xhr = new XMLHttpRequest();
// Initialize the request
xhr.open("GET", 'https://jsonplaceholder.typicode.com/users');
// Send the request
xhr.send();
// Fired once the request completes successfully
xhr.onload = function(e) {
// Check if the request was a success
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
// Get and convert the responseText into JSON
var response = JSON.parse(xhr.responseText);
console.log(response);
}
}
Post request:
// Create the XMLHttpRequest object.
const xhr = new XMLHttpRequest();
// Initialize the request
xhr.open("POST", 'https://jsonplaceholder.typicode.com/users', true);
// Set content type
xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8');
// Send the request with data to post
xhr.send(
JSON.stringify({
name : "Jon Doe",
username : "jon-doe",
email : 'jon-doe@unknown.com'
})
);
// Fired once the request completes successfully
xhr.onload = function(e) {
// Check if the request was a success
if (this.readyState === XMLHttpRequest.DONE && this.status === 201) {
// Get and convert the responseText into JSON
var response = JSON.parse(xhr.responseText);
console.log(response);
}
}
2. Using fetch() method:
fetch()
method is the newer, easier, and best method to make Ajax requests. The fetch()
method returns a promise that can be used to handle the response data. Though, this method won’t work on old browsers like Internet Explorer.
Get request:
// Create and Send the request
var fetch_status;
fetch('https://jsonplaceholder.typicode.com/userssss', {
method: "GET",
headers: {
"Content-type": "application/json;charset=UTF-8"
}
})
.then(function (response) {
// Save the response status in a variable to use later.
fetch_status = response.status;
// Handle success
// eg. Convert the response to JSON and return
return response.json();
})
.then(function (json) {
// Check if the response were success
if (fetch_status == 200) {
// Use the converted JSON
console.log(json);
}
})
.catch(function (error){
// Catch errors
console.log(error);
});
Post request:
// Create and Send the request
var fetch_status;
fetch('https://jsonplaceholder.typicode.com/users', {
method: "POST",
// Set the headers
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
// Set the post data
body: JSON.stringify({
name : "Jon Doe",
username : "jon-doe",
email : 'jon-doe@unknown.com'
})
})
.then(function (response) {
// Save the response status in a variable to use later.
fetch_status = response.status;
// Handle success
// eg. Convert the response to JSON and return
return response.json();
})
.then(function (json) {
// Check if the response were success
if (fetch_status == 201) {
// Use the converted JSON
console.log(json);
}
})
.catch(function (error){
// Catch errors
console.log(error);
});
In the above snippets, once the fetch()
method’s request is successfully executed on the server, the first then()
method converts the response data info a JavaScript object. Then, in the second then()
method, we can use the object to do whatever we want to do. If there were any errors encountered in the chain, it would pass into the catch()
method.