Skip to content

Instantly share code, notes, and snippets.

View towfiqpiash's full-sized avatar
🌴
On vacation

Towfiqur Rahman towfiqpiash

🌴
On vacation
View GitHub Profile
@towfiqpiash
towfiqpiash / fix-errors.md
Last active August 15, 2017 15:46
Commands to fix random errors

Google's missing GPG key error on apt update

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
@towfiqpiash
towfiqpiash / laravel-erros.md
Last active September 10, 2017 10:12
Laravel related errors and solutions

[InvalidArgumentException] Script "post-install-cmd" is not defined in this package"

Solution#1

Run composer global self-update

Solution#2

Update laravel installer version first. To do this, change the version required in ~/config/composer/composer.json from ^1.3 to dev-master, then run composer update laravel/installer.

@towfiqpiash
towfiqpiash / orcale-jdk7-moved-permanently.md
Last active July 26, 2018 07:20
When apt-get installing oracle java 7 stopped working, try this

Or,

Install Oracle JDK 7 We assume that you already downloaded jdk-7u80-linux-x64.tar.gz file from Java archive download page.

Extract the downloaded file.

@towfiqpiash
towfiqpiash / sublime-setting-user.json
Last active September 21, 2017 09:18
Small visual tweaks for sublime text
{
"line_padding_bottom": 5,
"line_padding_top": 5,
"fade_fold_buttons": false,
"bold_folder_labels": true
}
@towfiqpiash
towfiqpiash / sync-hardware-datetime-with-system.md
Last active September 23, 2017 05:44
When your Linux date time is not same as hardware date time, this gist can be your guide

For quick adjustment, Check (2) and/or (4)

The clock that is managed by Linux kernel is not the same as the hardware clock. Hardware clock runs even when you shutdown your system. Hardware clock is also called as BIOS clock. You can change the date and time of the hardware clock from the BIOS. However, when the system is up and running, you can still view and set the hardware date and time using Linux hwclock command as explained in this tutorial.

1. Display Hardware Clock Date and Time

Just type hwclock, which will display the date and time of your system’s hardware clock. This is the same date and time that you’ll see from the BIOS screen. You can also use option -r, or –show to display the date and time.

# hwclock
@towfiqpiash
towfiqpiash / districts.json
Created September 28, 2017 05:17
All districts of bangladesh in JSON format
{
"data":{
"কুমিল্লা":null,
"ফেনী":null,
"ব্রাহ্মণবাড়িয়া":null,
"রাঙ্গামাটি":null,
"নোয়াখালী":null,
"চাঁদপুর":null,
"লক্ষ্মীপুর":null,
"চট্টগ্রাম":null,
@towfiqpiash
towfiqpiash / add-custom-font-wordpress.css
Last active October 4, 2017 18:25
How to add custom font to wordpress
/*
Follow these steps:
--------------------
1. Convert ttf font (e.g. solaimaniLipi.ttf) to woff using any of font-face generator tool online
2. Upload solaimaniLipi.woff to themename/assets/fonts/solaimaniLipi.woff
3. Add @font-face code to themename/style.css
4. Use font-family name anywhere you want to use this font
*/
@font-face {
font-family: solaimaniLipi;
@towfiqpiash
towfiqpiash / html2plainText.js
Last active October 12, 2022 10:54
Javascript function to convert HTML to plain text
// converts HTML to text using Javascript
function html2text(html) {
var tag = document.createElement('div');
tag.innerHTML = html;
return tag.innerText;
}
// Convert Any copied text to plain text in TinyMCE (strip all tags)
paste_preprocess: function(plugin, args) {
@towfiqpiash
towfiqpiash / ttf-mscorefonts-installer-fix.md
Created November 14, 2017 16:07
Failed to download extra data files ttf-mscorefonts-installer

The 3.4 version of the ttf-mecorefonts-installer package is broken.

Sourceforge (where the actual font files are downloaded from) changed the location that the fonts are stored rendering the package broken. I'd suggest purging that broken 3.4 version of the package and instead install the 3.6 version of the package from an alternative source, eg

To get rid of the current package

sudo apt purge ttf-mscorefonts-installer

To download the 3.6 version of the package to your Downloads folder

@towfiqpiash
towfiqpiash / visualcode.md
Last active December 5, 2017 10:01
Microsoft Visual Code Shortcuts & Tips

Lesson 12 (Done)

Extensions

  1. Sublime Text Keymap
  2. Advanced New File (patbenatar)
  3. File utils
  4. PHP Intelephense
  5. Snippet creator
  6. Laravel Artisan