Skip to content

Instantly share code, notes, and snippets.


Marek Kasztelnik mkasztelnik

View GitHub Profile
mkasztelnik / oauth_controller.rb
Created Nov 8, 2012 — forked from dblock/oauth_controller.rb
An updated OAuth2 controller for a Rails app (implies you have ClientApplication and AccessGrant)
View oauth_controller.rb
class OauthController < ApplicationController
class ApiOAuthError < StandardError
attr_accessor :code, :description, :uri, :state
def initialize(code, description, uri = nil, state = nil)
@code = code
@description = description
@uri = uri
mkasztelnik / global.rb
Created Nov 15, 2012 — forked from colinsurprenant/global.rb
shared global ruby configuration dsl example
View global.rb
module App
module Global
extend self
def self.configure(&block)
def [](key)
mkasztelnik / gist:8554323
Created Jan 22, 2014
SublimeText3 (linux) and guard tests executed while clicking ctr+s
View gist:8554323
# Add following line into "Settings - User" (Preferences->Settings - User)
"atomic_save": false
mkasztelnik / .vimrc.bundles.local
Last active Feb 29, 2016
dotfile local changes
View .vimrc.bundles.local
Plug 'elixir-lang/vim-elixir'
Plug 'altercation/vim-colors-solarized'
Plug 'janko-m/vim-test'
Plug 'scrooloose/nerdtree'
Plug 'rking/ag.vim'
View experiment_exporter_controller.rb
require './lib/exporters/experiment_exporter'
module Api
module V1
class ExperimentExporterController < Api::ApiController
include ActionController::Live
def show
authorize! :read, :experiment_exporter
# experiment_id = params[:id]
mkasztelnik / compile_nginx
Last active Feb 20, 2018
nginx AAI proxy
View compile_nginx
# In the scope of first prototype nginx with http_auth_request, http_ssl module is used.
# At the beginning nginx need to downloaded (, next configured and installed:
./configure --prefix=/home/marek/epos/nginx --with-http_auth_request_module --with-http_ssl_module
make install
mkasztelnik / compile_openresty
Last active Feb 20, 2018
nginx AAI + user details
View compile_openresty
# When additional headers need to be forwarded into upstream than lua nginx module should be used.
# The simplest way to have lua support in nginx is to use openresty (
# After sources are downloaded and extracted from the archive we can compile openresty
# (or nginx with `lua`, `cjson` and `http_ssl` modules can be compiled):
./configure --prefix=/home/marek/epos/openresty --with-http_ssl_module
make install