Skip to content

Instantly share code, notes, and snippets.

View bwonur's full-sized avatar
☂️
I may be slow to respond.

bwonur

☂️
I may be slow to respond.
View GitHub Profile
@bwonur
bwonur / htaccess-security.php
Created February 10, 2020 08:47 — forked from bUxEE/htaccess-security.php
htaccess security settings
# START SECURITY
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
@bwonur
bwonur / .htaccess
Last active February 10, 2020 08:53
.htaccess Güvenliği
# START SECURITY
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
@bwonur
bwonur / .htaccess
Created February 10, 2020 06:21 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@bwonur
bwonur / background-blur.css
Created February 5, 2020 09:26
background-blur.css
.background-blur
{
backdrop-filter: saturate(180%) blur(20px);
background-color: rgba(255,255,255,0.7);
}
@bwonur
bwonur / reCaptcha-2.html
Created February 3, 2020 07:54
PHP ile reCaptcha 2 kurulumu
Web sitelerimizde form işlemlerini kullanırken bazı güvenlik önlemleri almamız gerekiyor. Bunlardan en yaygın kullanılan yöntemlerden biri de captcha kullanımıdır. Kendi captchanızı oluştabileceğiniz gibi bazı hazır captcha servislerini de kullanabilirsiniz.
Hazır captcha servislerinden en yaygını da google tarafından hazırlanmış olan reCaptcha`dır. Yakın tarihlerde reCaptcha 1. versiyonunu devre dışı bırakarak bir süredir test ettiği reCaptcha 2. sürümüne tam olarak geçti.
Aşağıdaki videoda reCaptcha 2 nasıl alınır ve php ile nasıl kullanılır göstermeye çalıştım.
Kaynak olarak şuradaki bilgileri kullanabilir ve şuradan reCaptcha oluşturabilirsiniz.
`
@bwonur
bwonur / turkiye-il-ilce.JSON
Last active January 29, 2020 09:43
Türkiye İl / İlçe (HTML SELECT) + JSON DATA
$ililce = [{
"bolge": "AKDENİZ",
"id": 1,
"il": "ADANA",
"ilce": "ALADAĞ",
"plaka": 1
},
{
"bolge": "AKDENİZ",
"id": 2,
@bwonur
bwonur / HOW TO ZOOM IMAGE WITH PURE JAVASCRIPT.md
Created January 27, 2020 14:23
HOW TO ZOOM IMAGE WITH PURE JAVASCRIPT

When you are building an e-commerce website, especially a showcase, a website gallery, a template selling website ..., you always need many good images for using and giving your visitors/customers the detailed view of your images (or your product). I believe that every shopping website has ability zoom the product image. All of them are using jQuery plugins such as jQuery Zoom or EasyZoom After I think how would I implements this plugin I realized that we do not need jQuery for that. So let us go step by step and implement image zoom without jQuery.

We will have next html template:

`

` We will display a small image and set the background for figure element with the same image but without scaling. We are going to fade out the image and change background position of figure element based on cursor coordinates.
@bwonur
bwonur / gist:8f78b78a9108ffca42a5d7494f12236e
Created January 27, 2020 13:13 — forked from oswaldoacauan/gist:7580474
jQuery - Serialize Form with File inputs
(function($) {
$.fn.serializeFiles = function() {
var form = $(this),
formData = new FormData()
formParams = form.serializeArray();
$.each(form.find('input[type="file"]'), function(i, tag) {
$.each($(tag)[0].files, function(i, file) {
formData.append(tag.name, file);
});
@bwonur
bwonur / fa-icons-list.txt
Created January 22, 2020 14:39 — forked from antoineMoPa/fa-icons-list.txt
Font-Awesome Icons List for version 4.3.0
fa-glass
fa-music
fa-search
fa-envelope-o
fa-heart
fa-star
fa-star-o
fa-user
fa-film
fa-th-large
@bwonur
bwonur / remove-post-revisions.md
Last active January 20, 2020 08:28
Disable WordPress Revisions for a Specific "post_type" only.

Remove the revisions property inside the supports parameter of register_post_type().

Example

$args = array(
    // ...
    'supports' => array('title','editor','thumbnail','comments','revisions')
); 
register_post_type('book',$args);