Skip to content

Instantly share code, notes, and snippets.

View shabbirbhimani's full-sized avatar
💭
:)

Shabbir Bhimani shabbirbhimani

💭
:)
View GitHub Profile
@shabbirbhimani
shabbirbhimani / _trackPageview.js
Created June 28, 2019 06:41
Legacy Google Analytics Code
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
setTimeout(function(){_gaq.push(['_trackEvent', 'timeOnSite', '60seconds', window.location.href])}, 60000);
@shabbirbhimani
shabbirbhimani / functions.php
Created May 1, 2019 14:29
Disable Tags Completely in WordPress
<?php
//* Do NOT include the opening php tag above. Copy the code shown below.
function unregister_tags() {
unregister_taxonomy_for_object_type( 'post_tag', 'post' );
}
add_action( 'init', 'unregister_tags' );
@shabbirbhimani
shabbirbhimani / robots.txt
Last active May 1, 2019 12:33
Robots.txt file for WordPress
User-agent: *
Disallow: /go/
Disallow: /recommended/
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /comments/feed/
Disallow: /trackback/
Disallow: /xmlrpc.php
sitemap: /sitemap_index.xml
@shabbirbhimani
shabbirbhimani / .htaccess
Last active May 1, 2019 04:43
Generic htaccess code to redirect www version of site to non-www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
@shabbirbhimani
shabbirbhimani / .htaccess
Last active May 1, 2019 04:43
Generic htaccess code to redirect non-www to www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
@shabbirbhimani
shabbirbhimani / jQuery.js
Created December 5, 2018 12:41
jQuery Ready
jQuery( document ).ready(function() {
console.log( "ready!" );
});
{
int a;
a=10;
cout<<a;
}
#include<iostream> //CPP input output stream header file
using namespace std; //always end your line by a semicolon(;)
int main(){ //main() it’s here where compiler starts running program from
cout<<”hello world”; //cout is standard output for cpp
return 1;
}// Hurray after this small code you can call yourself a coder :p
@shabbirbhimani
shabbirbhimani / ga.js
Created May 16, 2018 05:08
Google Analytics Code to add Anonymize IP
ga('create', 'UA-XXXXXXX-XX', 'auto');
ga('set', 'anonymizeIp', true); // Should be called before the ga('send', 'pageview');
ga('send', 'pageview');