This file contains hidden or 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
//Import jQuery | |
var url = "https://nodetent.com/"; | |
$.ajax({ | |
url: 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=' + url + '&screenshot=true', | |
context: this, | |
type: 'GET', | |
dataType: 'json', | |
timeout: 60000, | |
success: function(result) { |
This file contains hidden or 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
cd\Program Files\Microsoft Office\Office16 | |
cd\Program Files (x86)\Microsoft Office\Office16 | |
cscript OSPP.VBS /sethst:kms.digiboy.ir | |
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus | |
slmgr.vbs /ckms |
This file contains hidden or 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
ffmpeg -re -i "http://example.com/live/username/password/1234.m3u8" -bsf:a aac_adtstoasc -r 30 -b:v 2048k -bufsize 2048k -maxrate 4296k -vf scale="1280:720" -vcodec libx264 -preset ultrafast -c:a copy -f flv "rtmp://freertmpserver.com/servername/keyname" |
This file contains hidden or 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
# Apache Server Configs v2.14 | MIT License | |
# https://github.com/h5bp/server-configs-apache | |
# (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
# access to the main server configuration file (which is usually called | |
# `httpd.conf`), you should add this logic there. | |
# | |
# https://httpd.apache.org/docs/current/howto/htaccess.html. | |
# ---------------------------------------------------------------------- |
This file contains hidden or 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
<?php | |
function getAllLinks($url){ | |
$urlData = file_get_contents($url); | |
$dom = new DOMDocument(); | |
@$dom->loadHTML($urlData); | |
$xpath = new DOMXPath($dom); | |
$hrefs = $xpath->evaluate("/html/body//a"); | |
for($i = 0; $i < $hrefs->length; $i++){ | |
$href = $hrefs->item($i); |
This file contains hidden or 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
<?php | |
function convertSecToTime($sec){ | |
$date1 = new DateTime("@0"); //starting seconds | |
$date2 = new DateTime("@$sec"); // ending seconds | |
$interval = date_diff($date1, $date2); //the time difference | |
return $interval->format('%y Years, %m months, %d days, %h hours, %i minutes and %s seconds'); // convert into Years, Months, Days, Hours, Minutes and Seconds | |
} | |
echo convertSecToTime(246395678); | |
//OUTPUT: 7 Years, 9 months, 21 days, 19 hours, 14 minutes and 38 seconds | |
?> |
This file contains hidden or 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>Github</title> | |
</head> | |
<body> | |
<script language="javascript"> | |
var message=""; | |
function clickIE() {if (document.all) {(message);return false;}} |
This file contains hidden or 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
/* ------ Large screens ----------- */ | |
@media only screen and (min-width : 1824px) { | |
/* Styles go here.. */ | |
} | |
/* ------ Desktops and laptops ----------- */ | |
@media only screen and (min-width : 1224px) { | |
/* Styles go here.. */ | |
} | |
/* ------ Smartphones (portrait and landscape) ----- */ |
This file contains hidden or 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
<?php | |
function parseDescription($html) { | |
// Get the 'content' attribute value in a <meta name="description" ... /> | |
$matches = array(); | |
// Search for <meta name="description" content="Buy my stuff" /> | |
preg_match('/<meta.*?name=("|\')description("|\').*?content=("|\')(.*?)("|\')/i', $html, $matches); | |
if (count($matches) > 4) { | |
return trim($matches[4]); | |
} |
This file contains hidden or 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
<?php | |
function CCValidate($type, $cNum) { | |
switch ($type) { | |
case "American": | |
$pattern = "/^([34|37]{2})([0-9]{13})$/";//American Express | |
return (preg_match($pattern,$cNum)) ? true : false; | |
break; | |
case "Dinners": | |
$pattern = "/^([30|36|38]{2})([0-9]{12})$/";//Diner's Club | |
return (preg_match($pattern,$cNum)) ? true : false; |