Skip to content

Instantly share code, notes, and snippets.

View musamamasood's full-sized avatar
🎯
Focusing

Muhammad Usama Masood musamamasood

🎯
Focusing
View GitHub Profile
@musamamasood
musamamasood / bash.sh
Created October 16, 2016 10:40
Scrapper in Mac OX
If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the
job—for example:
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
@musamamasood
musamamasood / style.css
Created September 30, 2016 02:37
Widget Style
/**
* 10.0 - Widgets
*/
#blog-sidebar .widget {
border-top: 4px solid #FECE00;
margin-bottom: 3.5em;
padding-top: 1.75em;
}
#blog-sidebar .widget-area > :last-child,
#blog-sidebar .widget > :last-child {
@musamamasood
musamamasood / transfer.php
Last active June 30, 2021 22:14
Transfer files to server with publicly accessible zip file.
<?PHP
/**
* Transfer Files Server to Server using PHP Copy and PHP ZipArchive
* @link https://glowLogix.com
*/
/* Source File URL */
$remote_file_url = 'http://example.com/filename.zip';
/* New file name and path for this file */
@musamamasood
musamamasood / gist:f71fe99071447f36f70468081dd742cb
Created September 16, 2016 18:39 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@musamamasood
musamamasood / async.php
Created September 6, 2016 14:23 — forked from allenmoore/async.php
Async an arrayed list of JavaScript files with script_loader_tag
/**
* Function to Async an arrayed list of JavaScript files.
*
* @param $tag
* @param $handler
* @param $src
*
* @return mixed
*/
function async_scripts( $tag, $handler, $src ) {
@musamamasood
musamamasood / accessibility.txt
Created September 2, 2016 23:34
Accessibility Guideline
--------------------
1- Images should have alt tags.
2- Links should have alt tag if using with images.
3- ARIA role should need to add for html section.
4- ARIA attributes need to add for html elements. ** https://www.sitepoint.com/how-to-use-aria-effectively-with-html5/
Accessibility Plugins:
https://wordpress.org/plugins/access-monitor/
https://wordpress.org/plugins/wa11y/
@musamamasood
musamamasood / gulp.js
Created September 2, 2016 15:11
Compiles SCSS files into CSS
/**
* Compiles SCSS files into CSS
*
* @src .scss files that do not start with _
* @dest .css files
*/
gulp.task('scss', function() {
return gulp.src(['scss/**/*.scss', '!scss/**/_*'])
.pipe(scss())
.pipe(gulp.dest('css'));
@musamamasood
musamamasood / functions.php
Created August 26, 2016 11:34
Using HTML in a Shortcode
// Add Shortcode
function nebco_bannerboxes() {
/* Turn on buffering */
ob_start(); ?>
<div class="box first-box hvr-top hvr-underline-from-center">
<hr class="vertical">
<h4>THE NEBCO</h4><h4>STORY</h4>
<a href="#">
<p class="et_pb_button butt custum-butt">READ MORE</p>
@musamamasood
musamamasood / functions.php
Created August 23, 2016 12:51
Hide PHP Warnings and Notices in WordPress
ini_set('log_errors','On');
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@musamamasood
musamamasood / gist:3e7bd9c28cfe44dcd17c343b2b6f4ac2
Created August 16, 2016 17:38 — forked from lucasstark/gist:5612750
WooCommerce Dynamic Pricing - Display the discounts available for a particular product category.
add_action('woocommerce_single_product_summary', 'my_after_woocommerce_single_product_summary', 21);
function my_after_woocommerce_single_product_summary() {
global $post, $product;
if (is_object_in_term($post->ID, 'product_cat', array('tshirts'))) {
echo 'Your Custom Pricing Table';
}
}