Skip to content

Instantly share code, notes, and snippets.

@jpthompson23
jpthompson23 / HTTP_header_update_decorator.py
Last active March 24, 2016 09:46
Python decorator to update the header of an HTTP response from Flask or whatever
import flask
from flask.ext.classy import FlaskView, route
from functools import wraps
def charset_utf8(viewmethod):
# Let's update the 'Content-Type' in the HTTP header to tell the browser that the data we're
# responding with has utf-8 character encoding.
@wraps(viewmethod)
def new_viewmethod(*args, **kwargs):
resp = viewmethod(*args, **kwargs)
@esfand
esfand / typescript_angular.adoc
Last active September 30, 2022 12:37
AngularJS with TypeScript
@sr75
sr75 / wildcard-ssl-cert-for-testing-nginx-conf.md
Created June 1, 2013 18:35
create a self signed wildcard ssl cert for testing with nginx.conf example

just change out app_name for your purposes

openssl genrsa 2048 > app_name-wildcard.key

openssl req -new -x509 -nodes -sha1 -days 3650 -key app_name-wildcard.key > app_name-wildcard.cert

# Common Name (eg, your name or your server's hostname) []:*.app_name.com

openssl x509 -noout -fingerprint -text < app_name-wildcard.cert > app_name-wildcard.info