Categories
Uncategorized

Remove MySQL Duplicates

ALTER IGNORE TABLE `table_name` ADD UNIQUE (title, SID)

Do not allow duplicates

In Settings tab, you can try checking the following values:

  • Settings -> SQL Queries -> Ignore multiple statement errors

If you are using CSV format:

  • Settings -> Import -> CSV -> Do not abort on INSERT error

If you are using SQL format:

  • Settings -> Export -> SQL -> Use ignore inserts
Categories
Python Uncategorized

Python Redirect Path

import requests 
s = requests.Session()
response = s.get("https://google.com/")
cookies = dict(response.cookies)
if response.history:
    print ("Request was redirected")
    for resp in response.history:
        print (resp.status_code, resp.url)
    print ("Final destination:")
    print (response.status_code, response.url)
else:
    print ("Request was not redirected")
Categories
Uncategorized WordPress Development

is_front_page() && is_home() WordPress Default, Static and Blog Page

if ( is_front_page() && is_home() ) {
 // Default homepage

} elseif ( is_front_page()){
 //Static homepage

} elseif ( is_home()){

//Blog page

} else {

//everything else

}

Categories
Design Uncategorized

Top Website Design Research

Top Website Design Research Points

  • Use F-Shaped Pattern
  • Use Z-Shaped Pattern
  • Don’t let people more than 3 click to find their answer
  • Too many options ensure NONE will be chosen
  • Visitors read long widths of text faster, but prefer shorter widths
  • Your headlines draw even more eyes than images!
  • Image captions are the most consistently read in-post content
  • People follow the “line of sight” of other people
  • Don’t Make Users Wait: Speed Up Your Website
  • Make Your Content Easily Readable
  • Don’t Worry About “The Fold” and Vertical Scrolling
  • Place Important Content on the Left of a Web Page
  • Small Details Make a Huge Difference
  • Don’t Rely on Search as a Crutch to Bad Navigation
  • Your Home Page Isn’t As Important as You Think
  • Golden Ration in Web Design
    • Considering 900px total width page
      • Content area + Side bar
      • 900px / 1.62 = 555.55px = content area
      • Side bar = 345px
    • Considering for a rectangle block with 300px width
      • What is the height?
      • 300px/1.62 = 185px height
  • Mathematics and Design – Golden ration +The Rule of Thirds + Grid Systems

Source

Other Resources

Image Source : Pexels

Categories
Google Analytics Uncategorized

Click Tracking [Google Analytics]

Event Tracking

<script>
/**
* Function that tracks a click on a link in Google Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackLink = function(url) {
   ga('send', 'event', 'link', 'click', url, {
     'transport': 'beacon',
     'hitCallback': function(){document.location = url;}
   });
}
</script>

On Page Implementation

<a href="http://www.example.com" onclick="trackLink('http://www.example.com'); return false;">Visit example.com</a>