Skip to content

Instantly share code, notes, and snippets.

View mariadanieldeepak's full-sized avatar

Maria Daniel Deepak mariadanieldeepak

View GitHub Profile
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 300x250_sidebar -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-1XXXXXXXXXXXXXXX"
data-ad-slot="4XXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
function my_theme_remove_optins() {
if ( is_user_logged_in() ) {
wp_enqueue_script( 'remove-optin', 'remove-optin.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ) );
} elseif ( wp_script_is( 'remove-optin', 'enqueued' ) ) {
// This check is needed to show the Optin.
wp_dequeue_script( 'remove-optin' );
}
}
add_action( 'wp_enqueue_scripts', 'my_theme_remove_optins' );
function my_theme_remove_optins() {
wp_enqueue_script( 'remove-optin', 'remove-optin.js', array( 'jquery' ), wp_get_theme()->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'my_theme_remove_optins' );
@mariadanieldeepak
mariadanieldeepak / remove-optins.js
Last active April 25, 2017 18:01
Remove all Optins from WordPress posts
$( document ).ready(function() {
$( document ).on("OptinMonsterBeforeShow", function(a, b, c) {
// Remove all optins whose ID begins with 'om-'
$( "[id^='om-']" ).remove();
});
});
@mariadanieldeepak
mariadanieldeepak / install-mysql-on-mac-os-using-homebrew.sh
Last active April 6, 2017 05:24
Install MySQL on Mac OS Using Homebrew
# Check for Brew related problems
mariadanieldeepak@Marias-MacBook-Pro ~ $ brew doctor
# Update Homebrew and all new forumulae
mariadanieldeepak@Marias-MacBook-Pro ~ $ brew update
# Install MySQL
mariadanieldeepak@Marias-MacBook-Pro ~ $ brew install mysql
# Secure MySQL installation
@mariadanieldeepak
mariadanieldeepak / script.js
Last active January 27, 2017 08:58
02: Add/remove multiple attributes using jQuery
$( document ).ready(function() {
// Remove multiple attributes
$( 'input.multiple-attr-remove' ).removeAttr( 'id name' );
// Add multiple attributes
$( 'input.multiple-attr-add' ).attr( {'id': 'useremail', 'name': 'useremail' } );
});
@mariadanieldeepak
mariadanieldeepak / index.html
Created January 27, 2017 08:52
01: Add/remove multiple attributes using jQuery
UserName <br />
<input type="text" id="username" name="username" class="multiple-attr-remove" />
<br /><br />
UserEmail <br />
<input type="text" class="multiple-attr-add" />
@mariadanieldeepak
mariadanieldeepak / Navigate to Downloads directory
Created September 15, 2016 16:35
Navigate to Downloads directory to install the downloaded file.
cd ~/Downloads
@mariadanieldeepak
mariadanieldeepak / Install Sublime Text 3
Created September 15, 2016 16:32
Install Sublime Text 3 using the downloaded .deb file
sudo apt install sublime-text_bulid-3083_amd64.deb