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 / Laravel5-cheatsheet.md
Last active May 23, 2017 11:51
Laravel 5 Cheat Sheet

Laravel 5 Cheat Sheet

Artisan

// Added in 5.1.11:http://laravel.com/docs/5.1/authorization#creating-policies
php artisan make:policy PostPolicy

// Displays help for a given command
@towfiqpiash
towfiqpiash / git_cheatsheet.md
Last active July 23, 2017 04:51
All about git

Get latest changes from master to branch

git checkout piash      # gets you "on branch piash"
git fetch origin        # gets you up to date with origin
git merge origin/master

Merge detached head to origin/master

git checkout master && git merge [ref of HEAD]    # ref of HEAD = latest hash of detached head
@towfiqpiash
towfiqpiash / auto-indent-sublime-text3.md
Created July 23, 2017 05:05
Auto-indenting on Sublime Text 3

Just add this binding to your Preferences > "Key Bindings - User" file:

{"keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false}}
@towfiqpiash
towfiqpiash / format-bootale-usb-stick.md
Created July 23, 2017 05:10
Format bootable USB stick on Ubuntu
  1. On your dash bar, type disks and lunch the program
  2. Select the disk or drive you want to format
  3. Press CTRL+F
  4. Click format.

After formatting, the disk or drive would be unallocated, therefore you'll have to create a partition by using the plus button on the screen.. Then insert the name you'll like to use as the drive or disk name then click on create. Enjoy....

@towfiqpiash
towfiqpiash / PowerLinux.md
Last active August 15, 2017 15:41
Learn few commands to make linux life a breeze

Which command I use most?

history | awk '{print $2}' | sort | uniq -c | sort -rn | head -10
@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 / 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,