Skip to content

Instantly share code, notes, and snippets.

View athlonUA's full-sized avatar
:octocat:
I may be slow to respond.

Alexander G. athlonUA

:octocat:
I may be slow to respond.
View GitHub Profile
@athlonUA
athlonUA / nginx_remove_double_slashes.md
Created August 2, 2018 12:08 — forked from JustThomas/nginx_remove_double_slashes.md
nginx: Remove double slashes from URLs

Put the following directives in your server block. nginx will then redirect URLs with double (or triple or multiple) slashes to the corresponding URL with a single slash.

merge_slashes off;
rewrite ^(.*?)//+(.*?)$ $1/$2 permanent;
@athlonUA
athlonUA / object-to-form-data.js
Created June 19, 2017 13:39 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {