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 / 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 / .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 / 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