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
<?php | |
setlocale(LC_ALL, 'en_US.UTF8'); | |
function slugit($str, $replace=array(), $delimiter='-') { | |
if ( !empty($replace) ) { | |
$str = str_replace((array)$replace, ' ', $str); | |
} | |
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str); | |
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean); | |
$clean = strtolower(trim($clean, '-')); | |
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean); |
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
<?php | |
/** | |
* Rewrite WordPress URLs to match Blogger permalinks exactly. | |
* | |
* This script is intended for one time use only after importing Blogger | |
* content into WordPress and should be removed from the server immediately | |
* after the script has run one time. It shouldn't be needed again after the | |
* initial rewrite. | |
* | |
* @version 0.1.0 |
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 = $_POST['bin']; | |
$length = $_POST['length']; | |
if ( $length == 0 ) | |
$length = 16; | |
if ( $bin != '' ) | |
$cardNumber = completed_number( $bin, $length ); |
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
<?php | |
// This is PHP function to convert a user-supplied URL to just the domain name, | |
// which I use as the link text. | |
// Remember you still need to use htmlspecialchars() or similar to escape the | |
// result. | |
function url_to_domain($url) | |
{ |
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
<?php | |
function parseTitle($html) { | |
// Get the text in a <title> | |
$matches = array(); | |
preg_match("/<title>(.*)<\/title>/is", $html, $matches); | |
if (count($matches) > 1) { | |
return trim($matches[1]); | |
} else { | |
return null; | |
} |
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
<?php | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
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
<?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 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 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
// WARNING: jquery required! | |
// jquery cdn: https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js | |
function detectAdblock(selector) { | |
return ($($(selector)[0]).css('display') == 'none'); | |
} | |
function preventAdblockStyles(selector) { | |
$(selector).attr('style', 'display: block!important;visibility: visible!important;text-decoration: none!important;'); | |
} |
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
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 |
OlderNewer