Skip to content

Instantly share code, notes, and snippets.

View khaledMohammed000's full-sized avatar
🎯
Focusing

Mohammed Khaled khaledMohammed000

🎯
Focusing
View GitHub Profile
// removing attribute href and width from divs
// for html code go here for testing : http://pastebin.com/ZBwEJsQ8
$dom = new DOMDocument;
$dom->loadHTML($content);
$divs = $dom->getElementsByTagName('div');
foreach ($divs as $div) {
$div->removeAttribute('href');
$div->removeAttribute('width');
}
$content = $dom->saveHTML();
@khaledMohammed000
khaledMohammed000 / index.php
Created February 3, 2017 07:03
code on the sub domain url
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title>Disqus for AMP</title>
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style>
html, body {
margin: 0;
@khaledMohammed000
khaledMohammed000 / index.php
Created February 1, 2017 05:58
Final code for Home page modification
<?php
/*
Plugin Name: AMP Home Page Modify
Version: 0.0.1
Author: Mohammed Khaled
Author URI: https://ampforwp.com/
Donate link: https://www.paypal.me/Kaludi/5
License: GPL2
*/
// Exit if accessed directly.
@khaledMohammed000
khaledMohammed000 / index.php
Created January 31, 2017 06:26
Start file for Home Page Modify
<?php
/*
Plugin Name: AMP Home Page Modify
Version: 0.0.1
Author: Mohammed Khaled
Author URI: https://ampforwp.com/
Donate link: https://www.paypal.me/Kaludi/5
License: GPL2
*/
// Exit if accessed directly.
@khaledMohammed000
khaledMohammed000 / index.php
Last active February 1, 2017 13:49
final code for the extension
<?php
/*
Plugin Name: AMP Nav Links
Version: 0.0.1
Author: Mohammed Khaled
Author URI: https://ampforwp.com/
Donate link: https://www.paypal.me/Kaludi/5
License: GPL2
*/
@khaledMohammed000
khaledMohammed000 / index.php
Created January 30, 2017 10:52
starting code
<?php
/*
Plugin Name: AMP nav links modify
Version: 0.0.1
Author: Mohammed Khaled
Author URI: https://ampforwp.com/
Donate link: https://www.paypal.me/Kaludi/5
License: GPL2
*/
<script type="application/ld+json">{
"@context":"http:\/\/schema.org",
"@type":"BlogPosting",
"mainEntityOfPage":"http:\/\/localhost\/wordpress\/2015\/11\/25\/chrome-9-goes-stable-with-webgl-and-chrome-instant\/",
"publisher":{
"@type":"Organization",
"name":"final tests",
"logo":{
"@type":"ImageObject",
"url":"",
<iframe
width="600"
height="450"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY
&q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>
@khaledMohammed000
khaledMohammed000 / gist:f18385f9d9b5fab9117c6790710e7e7c
Created April 26, 2016 06:40
Small bit of code for using Picasso inour getView() in Adapter class
public class MoviesAdapter extends BaseAdapter {
private Context mContext;
private MoviesModel mArray[];
String posterPathReturnedByQuery = null;
String finalImageURL = null;
final public String BaseImageURL = "http://image.tmdb.org/t/p/";
final public String StandardSIzeOfImages = "w185";