Skip to content

Instantly share code, notes, and snippets.

View mindvox's full-sized avatar

Karl Bateman mindvox

View GitHub Profile
@mindvox
mindvox / nginx.conf
Created July 6, 2017 13:54 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@mindvox
mindvox / checkUrlExists.m1.py
Created January 19, 2016 19:30 — forked from fedir/checkUrlExists.m1.py
Check if URL exists via Python
from urllib2 import urlopen
code = urlopen("http://example.com/").code
if (code / 100 >= 4):
print "Nothing there."
# via http://stackoverflow.com/questions/1966086/how-can-i-determine-if-anything-at-the-given-url-does-exist