Skip to content

Instantly share code, notes, and snippets.

View abdulawal39's full-sized avatar
🎯
Focusing

Abdul Awal Uzzal abdulawal39

🎯
Focusing
View GitHub Profile
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@squallstar
squallstar / viewer.html
Created January 26, 2017 21:20
Pinch gestures for pdf.js
<script type="text/javascript">
var gesturesSetUp = false;
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
document.addEventListener('textlayerrendered', function (e) {
if (gesturesSetUp || e.detail.pageNumber !== PDFViewerApplication.page) {
return;
}
@hasanet
hasanet / bddistrict-shortcode.php
Last active October 25, 2019 05:12
Contact Form 7 Shortcode - List of Bangladesh Districts (All 64 Districts of Bangladesh)
<?php
/*
CREATED: January 17, 2017.
Instructions:
- This shortcode can be used to show all the 64 districts of Bangladesh as a dropdown menu within Contact Form 7.
- The list will show Alphabetically and it is available for Both Bangla and English Language.
- This is not a plugin. So, Do not Download this file and install it on your wordpress site. Just copy any of the below code and paste it on the "form editor" of Wordpress Contact form 7 Plugin.
@diegopacheco
diegopacheco / linux-files-bigger100mb.md
Created October 31, 2016 16:26
Linux List all files bigger than 100MB
sudo find / -size +100M -exec sudo ls -l {} \;
@andrastudio
andrastudio / Envato Link.html
Last active June 16, 2020 00:43
Envato Buy Now Link to Checkout Page
@abdulawal39
abdulawal39 / hide-folder-list-from-public-without-password.php
Last active October 22, 2015 19:31
hide list of folders from public but let authorised people see with a special url
<?php
/**
* Hide List of folders from public with php
* Article url: http://abdulawal.com/hide-list-of-folders-from-public-with-php/
*/
$access = $_REQUEST['access'];
if($access == "admin"){
$dirs = array_filter(glob('*'), 'is_dir');
echo "<ul>";
@abdulawal39
abdulawal39 / extract-data-from-multi-select.php
Last active October 1, 2020 17:21
Extract Values from Multi Select DropDown with PHP
<?php
/**
* File Name: extract-data-from-multi-select.php
* Description: A Simple way to Extract Data from a Multi Select Input and Store in a variable with spearating each values with comma.
* Author: Abdul Awal Uzzal
* Author Url: abdulawal.com
* Article: http://themencode.com/?p=435
*/
if(isset($_POST['select_name'])){ // select_name will be replaced with your input filed name
@ghalusa
ghalusa / youtube_id_regex.php
Created June 20, 2015 23:14
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@j0lvera
j0lvera / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",
@freelancingcare
freelancingcare / wordpress-code-example.php
Last active June 5, 2020 08:40
Wordpress Code Referance From Practical Use
Root url for website
---------------------------------------------------------
<?php site_url(); ?>
<?php bloginfo('url'); ?>
title of specific post/page
---------------------------------------------------------
<?php wp_title(); ?>
Title of site