Skip to content

Instantly share code, notes, and snippets.

View ganmahmud's full-sized avatar
🎯
Focusing

Gan Mahmud ganmahmud

🎯
Focusing
View GitHub Profile
@ganmahmud
ganmahmud / send.php
Last active October 20, 2015 08:21
PHP Email Script
<?php
$name = @trim(stripslashes($_POST['name']));
$email = @trim(stripslashes($_POST['email']));
$msg = @trim(stripslashes($_POST['msg']));
$subject = 'PHP-AJAX Email' ; //type your email subject here
$to = 'you@your-email.com';//replace with your email
$headers = array();
$headers[] = "MIME-Version: 1.0";
@ganmahmud
ganmahmud / simpleScrape.php
Created January 18, 2016 19:24
Scrapping example with PHP (used for learning purpose only)
<?php
include("simple_html_dom.php");
$allLink = array();
$AllContent = array();
// Retrieve the DOM from a given URL
$html = file_get_html('http://www.bbc.co.uk/bengali');
foreach($html->find('.list li-plain,a') as $e){
@ganmahmud
ganmahmud / ajaxCompleteGist.js
Last active January 27, 2016 11:02
ajaxComplete handler
// recommended
$(document).bind('ready ajaxComplete', function(){
// Your code here
});
// you could also try this but remember $(document).on( "ready", handler ) is deprecated as of jQuery 1.8.
$(document).on('ready ajaxComplete', function(){
// Your code here
});
@ganmahmud
ganmahmud / hangman.py
Last active August 17, 2021 07:40
Simple algorithm for the Hangman text-based game
import random
wList=['Earth','Fire','Wind','Water','Heart','By','your','power','combined','I','am','Captain','Planet']
ind=random.randint(0,10) # generating random integer.In exam the range was 0 to 100.But we will use 0 to 10 here
the_word_beta1=wList[ind]
the_word_beta2=the_word_beta1.lower() # making all the chars lower case for avoiding upper case-lower case match conflict
the_word=the_word_beta2.strip() # taking out all the white spaces before and after the word as there is one word per line in the words.txt. If we don't do it the length of the word will not be correct
print(the_word)
wLen=len(the_word)
u='*'*wLen
counter=0
@ganmahmud
ganmahmud / mock.css
Last active February 9, 2016 09:14
Inside mock device
/*setup*/
* {
margin: 0;
padding: 0;
}
@font-face {
font-family: 'Monoton';
font-style: normal;
@ganmahmud
ganmahmud / custom.php
Created April 11, 2016 12:03
core\application\library\metabox\custom.php
'type' => 'select',
'name' => 'bus_name',
'label' => esc_html__('Select Business for this offer', 'themag'),
'default' => '',
'items' => SkilledTheme_Themag_SKL_Common::skilledtheme_themag_skl_business(),
@ganmahmud
ganmahmud / single-custom.php
Created April 11, 2016 12:05
In the single-custom.php
$arguments = array(
'post_type' => 'offer',
'post_status' => 'publish',
'meta_key' => 'bus_name',
'meta_value' => $somevalue,
'meta_compare' => 'LIKE',
'posts_per_page' => '-1',
'post__not_in'=> array(get_the_ID()),
@ganmahmud
ganmahmud / FormCSV.php
Last active December 25, 2018 06:22
Form data to CSV
<?php
class CSVExport
{
/**
* Constructor
*/
public function __construct()
{
@ganmahmud
ganmahmud / rtl.js
Created January 26, 2017 22:55
For RTL
jQuery(window).bind("load", function() {
// code here
if (jQuery("body").hasClass('rtl')){
var vc_rows = jQuery("body .vc_row");
for (var i = vc_rows.length - 1; i >= 0; i--) {
vc_rows.css('left', Math.abs(parseInt(vc_rows[i].style.left)));
};
}
@ganmahmud
ganmahmud / search_result.html
Created January 2, 2018 18:48
Angular Sample
<!-- search fields -->
<div class="container margin-t20">
<div class="row lnb">
<div class="col-sm-6 col-xs-6">
<div class="khojnow-brand">
<a href="../app"><img src="images/logo.png" alt="Logo" class="img-responsive"></a>
</div>
</div>