Skip to content

Instantly share code, notes, and snippets.

View joelbrewer's full-sized avatar

Joel Brewer joelbrewer

View GitHub Profile
@workmad3
workmad3 / after.vimrc
Last active December 28, 2015 16:39 — forked from anonymous/after.vimrc
" Extra packages {{{
Bundle "nono/vim-handlebars"
Bundle "leshill/vim-json"
Bundle "tpope/vim-bundler"
Bundle "fholgado/minibufexpl.vim"
Bundle "wavded/vim-stylus"
Bundle "altercation/vim-colors-solarized"
Bundle 'AutoTag'
Bundle "SuperTab"
" }}}
@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'