Skip to content

Instantly share code, notes, and snippets.

View nasirkhan's full-sized avatar
🚀
Focusing

Nasir Khan Saikat nasirkhan

🚀
Focusing
View GitHub Profile
@nasirkhan
nasirkhan / mysql_show_column_names
Last active August 29, 2015 14:01
Get all the column names of a MySQL database table
/*
* MY_DATABASE_NAME will be replaced by the name of your database
* MY_TABLE_NAME will be repaced by the name of your database table
*/
SELECT
`COLUMN_NAME`
FROM
`INFORMATION_SCHEMA`.`COLUMNS`
WHERE
@nasirkhan
nasirkhan / update_git_branch_from_master.markdown
Last active August 29, 2015 14:02
Git | Update a git Branch form Master

Checkout the branch git checkout Branch_01

Then merge: git merge origin/master

Then push: git push origin master

@nasirkhan
nasirkhan / migration_class_not_found_issue.md
Last active September 4, 2015 08:40
Laravel migration rollback issue, class not found
php composer.phar dump-autoload

or just use

composer dump-autoload
@nasirkhan
nasirkhan / post-commit
Created March 28, 2013 17:03
This is a post-commit hook for Github master and the Github Project Pages. You have to enable this hook at the github project root .git directory. The file path should be the following ".git/hooks/post-commit". If you are using Linux make sure the "post-commit" file has the execute permission. This hook will automatically sync the github master …
#!/bin/sh
# Mirror master in gh-pages
git checkout gh-pages
git merge master
git checkout master
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
git checkout gh-pages
git merge master
git push origin gh-pages
@nasirkhan
nasirkhan / API Format.md
Last active March 7, 2016 07:04
REST API Documenting Example

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@nasirkhan
nasirkhan / php and javascript page reditect.php
Last active April 6, 2016 11:16
php and javascript page reditect
$url = "index.php";
redirect($url);
function redirect($url) {
if (headers_sent()) {
die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
} else {
header('Location: ' . $url);
die();
}
@nasirkhan
nasirkhan / git command.md
Last active June 14, 2016 12:26
git discart local changes and pull form origin
git fetch --all
git reset --hard origin/master
@nasirkhan
nasirkhan / file-permission-change.sh
Created August 23, 2016 10:49
Fix the file and folder/directory permission on Linux
# For directories only do this.
find . -type d -exec chmod 755 {} \;
# For files only do this.
find . -type f -exec chmod 644 {} \;