Skip to content

Instantly share code, notes, and snippets.

@vmarcetic
vmarcetic / google_play_verification.rb
Created October 25, 2018 21:03 — forked from jkotchoff/google_play_verification.rb
Verifying an Android subscription in a Ruby on Rails app using the Google Play API
class GooglePlayVerification
require 'google/api_client'
# Refer:
# https://code.google.com/p/google-api-ruby-client/issues/detail?id=72
# and
# http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html
# and
# http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/
GOOGLE_KEY = 'xxx-xxx.apps.googleusercontent.com'

Keybase proof

I hereby claim:

  • I am vmarcetic on github.
  • I am vmarcetic (https://keybase.io/vmarcetic) on keybase.
  • I have a public key ASDLagV2rc-0BJIq6xEVDGPB3P923f1ljf6ZAVBlwzHZNgo

To claim this, I am signing this object:

@vmarcetic
vmarcetic / ability.rb
Created July 21, 2013 20:51
Better view of article on coderwall
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # This is used for not logged user if you have a need for it
if User.current_role == 'admin' # From ApplicationController we can get current_role and check it up against the role we want.
can :manage, :all
else
When starting a project that includes refinerycms-blog:
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*