Skip to content

Instantly share code, notes, and snippets.

View habovh's full-sized avatar
🦊

Jordan Becker habovh

🦊
View GitHub Profile
@habovh
habovh / angular.filters.nl2br.coffee
Last active July 22, 2016 18:36 — forked from kensnyder/angular.filters.nl2br.js
Safe NL2BR filter for Angular, compatible with linky. Transforms newlines ( \n) into HTML <br /> tags.
# nl2br linky-compatible Angular filter
# CoffeeScript Version (available in JS)
#
# Sample usage in html template:
# "xxx | nl2br"
# <div ng-bind-html=" YourString | nl2br "></div>
angular.module('nl2brFilter', []).filter('nl2br', ['$sanitize', ($sanitize) ->
tag = '<br />'
@habovh
habovh / cors_support.conf
Last active April 5, 2024 15:57 — forked from agouriou/nginx.conf
Example Nginx (> 1.9) configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs. Handle error status (4xx, 5xx) and expose headers.
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support.conf"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support.conf;
#
# A limitation to this method is that Nginx doesn't currently send headers