Skip to content

Instantly share code, notes, and snippets.

View mhasan3's full-sized avatar
🎯
Focusing

Mahmudul Hasan mhasan3

🎯
Focusing
View GitHub Profile
@mhasan3
mhasan3 / class-tgm-plugin-activation.php
Created September 21, 2017 18:20 — forked from al5dy/class-tgm-plugin-activation.php
TGM 'Warning: sprintf(): Too few arguments...' bugfix
/**
* Sets install skin strings for each individual plugin.
*
* Checks to see if the automatic activation flag is set and uses the
* the proper strings accordingly.
*
* @since 2.2.0
*/
public function add_strings() {
if ( 'update' === $this->options['install_type'] ) {
@mhasan3
mhasan3 / OrganizeFiles.sh
Created July 14, 2017 17:32 — forked from towfiqpiash/OrganizeFiles.sh
Run this shell script to organize files into separate folders
#!/bin/bash
folders='Compressed Documents Images Music Programs Videos'
ext_comp="*.zip *.tar.gz"
ext_doc="*.htm* *.php *.txt *.css *.doc* *.pdf *.PDF *.ppt* *.js"
ext_img="*.jp*g *.JPG *.png *.gif"
ext_music="*.mp3 *.aac *.wma"
ext_progrm="*.deb *.exe *.run"
ext_vid="*.mp4 *.mkv *.flv *.avi *.webm *.wmv"
if(!function_exists('_log')){
function _log( $message ) {
if( WP_DEBUG === true ){
if( is_array( $message ) || is_object( $message ) ){
error_log( print_r( $message, true ) );
} else {
error_log( $message );
}
}
}
@mhasan3
mhasan3 / gist:1cee7fb21e76dd9bc9ea1b09ebfbf2df
Created October 15, 2016 17:32 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@mhasan3
mhasan3 / 01 - Theme Testing Process.markdown
Last active December 1, 2016 19:26 — forked from AlphaGit/01 - Theme Testing Process.markdown
Theme testing process (from Wordpress Codex)

Theme Testing Process

from Theme Development (Wordpress Codex)

  • Fix PHP and WordPress errors. Add the following debug setting to your wp-config.php file to see deprecated function calls and other WordPress-related errors: define('WP_DEBUG', true);. See Deprecated Functions Hook for more information.
  • Check template files against Template File Checklist.
  • Do a run-through using the Theme Unit Test.
  • Validate HTML and CSS. See Validating a Website.
  • Check for JavaScript errors.
  • Test in all your target browsers. For example, IE7, IE8, IE9, Safari, Chrome, Opera, and Firefox.
  • Clean up any extraneous comments, debug settings, or TODO items.
find . -name '*.DS_Store' -type f -delete
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
1. Download the "Install OS X Yosemite.app" form App Store and keep it in Applications Folder
2. Open the Terminal and just hit the command
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
Then It will show the Following message
"Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
@mhasan3
mhasan3 / gist:c7fd5935025582f1729a
Last active September 1, 2015 09:11 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");