<!-- Place this data between the <head> tags of your website -->
<title>Page Title. Maximum length 60-70 characters</title>
<meta name="description" content="Page description. No longer than 155 characters." />
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@publisher_handle"> <!-- Non-Essential, But Required for Analytics -->
<meta name="twitter:title" content="Page Title">
<meta name="twitter:description" content="Page description less than 200 characters">
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I have used google finance calculator for this purpose | |
function convertCurrency($amount, $from, $to){ | |
$url = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to"; | |
$data = file_get_contents($url); | |
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted); | |
$converted = preg_replace("/[^0-9.]/", "", $converted[1]); | |
return round($converted, 3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i used regex which support varitey of global phone numbers | |
/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/gm | |
Positive - | |
+42 555.123.4567 | |
+1-(800)-123-4567 | |
+7 555 1234567 | |
+7(926)1234567 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
#lst is list | |
def most_common(lst): | |
return max(set(lst), key=lst.count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*If you have two different sites, one for mobile and another for desktop. When any user try to visit your desktop site | |
from mobile, then use below code on your desktop website in index.html or import this below code as external JS.*/ | |
// Add below code in your head tag | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script> | |
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script> | |
$(document).on('submit','form#smsform',function(e){ | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#NOTE : update below links for package URL for all wget URL before proceed | |
#NOTE : Before running do `chmod +x my_install.sh` && sudo ./my_install.sh | |
# Update System | |
sudo apt-get -y update | |
sudo apt-get dist-upgrade -y | |
##attempt to correct a system with broken dependencies in place. | |
sudo apt-get -f install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get API KEY from https://tinypng.com/developers | |
try | |
{ | |
\Tinify\setKey("W2zSUtK-Up2aS8Q6kQ-ndeHOL06SGHVz"); | |
//TinyPNG Compress Image | |
$filepath = public_path('images/' . "knowledge-tribe.png"); | |
$source = \Tinify\fromFile($filepath); | |
$source->toFile($filepath); | |
} catch( \Tinify\AccountException $e ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[opcache] | |
; Determines if Zend OPCache is enabled | |
opcache.enable=1 | |
; Determines if Zend OPCache is enabled for the CLI version of PHP | |
;opcache.enable_cli=1 | |
; The OPcache shared memory storage size. | |
opcache.memory_consumption=512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ~-~-~- How to use ~-~-~- | |
# You can directly download as use as it is. | |
# Everything is listed is only perfomance and security related lines | |
# Validate .htaccess from http://www.htaccesscheck.com/ | |
# Disable Directory Browsing: Security | |
Options All -Indexes | |
# If a dir is a symbol link, follow the link |
OlderNewer