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
#Deny access to .htaccess file | |
<FilesMatch "(\.htaccess)"> | |
Order deny,allow | |
Deny from all | |
</FilesMatch> | |
#Prevent Hotlinking | |
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^$ |
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
function remove_spaces($the_content) { | |
return preg_replace( '/[\p{Z}\s]{2,}/u', ' ', $the_content ); | |
} | |
add_filter('the_content', 'remove_spaces'); |
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
// these changing in themes_folder/function.php | |
// 1. Change the login logo | |
// Important: logo should be at least 323px by 67px. | |
// Here’s the code you’ll need: | |
function login_logo() { ?> | |
<style type="text/css"> | |
body.login div#login h1 a { |
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
<script> | |
if (typeof jQuery == 'undefined') { | |
// jQuery is not loaded | |
alert('No jQuery'); | |
} else { | |
alert(jQuery.fn.jquery); | |
} | |
</script> | |
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 | |
/* Non www to www php redirection for IIS6 */ | |
if (!strpos('|||' . $_SERVER['HTTP_HOST'],"www") && !isset($_REQUEST['rd'])) { | |
$redirect = "http://www.oguzhanbasar.com"; | |
if (isset($_SERVER['REQUEST_URI']) && strlen($_SERVER['REQUEST_URI'])>0) { | |
$redirect .= $_SERVER['REQUEST_URI']; | |
} | |
if (strpos($redirect,"?")) { | |
//$redirect .= "&rd=1"; | |
} else { |
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
file name: quick-add-new-user-wp.php and open this link on browser (for example): http://domain.com/quick-add-new-user-wp.php | |
<?php | |
// Adding a new user in Wordpress quickly | |
// coded by Ahmet Oguzhan Basar for OZIVISION | |
// 5:43 PM 9/15/2015 | |
$new_username = "oadmin"; | |
$new_username_password = generate_password(); | |
$new_username_email = "[email protected]"; |
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
#!/bin/bash | |
uuser="unsplash_user_name" | |
path="/home/aobasar/Pictures" | |
mkdir -p $path | |
size=$(xdpyinfo | grep dimensions | awk '{print $2}') | |
#if you dont care user | |
#curl "https://source.unsplash.com/user/$uuser/$size" --location --output $path/unsplash-random.jpeg | |
curl "https://source.unsplash.com/$size" --location --output $path/unsplash-random.jpeg |
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
javascript:(function(){ | |
var youtube = 'https://www.youtube.com/results?search_query='; | |
var query = prompt('video query'); | |
if(query != '') { | |
document.location.href = youtube + query; | |
} | |
})(); |