Skip to content

Instantly share code, notes, and snippets.

View fernandomantoan's full-sized avatar

Fernando Geraldo Mantoan fernandomantoan

View GitHub Profile
@fernandomantoan
fernandomantoan / CursorRecyclerAdapter.java
Created February 23, 2016 17:57 — forked from Shywim/CursorRecyclerAdapter.java
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@fernandomantoan
fernandomantoan / schema.sql
Created September 23, 2014 18:05
Schema for PostgreSQL to use with JdbcTokenStore (Spring Security OAuth2)
create table oauth_client_details (
client_id VARCHAR(256) PRIMARY KEY,
resource_ids VARCHAR(256),
client_secret VARCHAR(256),
scope VARCHAR(256),
authorized_grant_types VARCHAR(256),
web_server_redirect_uri VARCHAR(256),
authorities VARCHAR(256),
access_token_validity INTEGER,
refresh_token_validity INTEGER,
require_relative 'listener'
module CASino
class LogoutListener < CASino::Listener
def user_logged_out(url, redirect_immediately = false)
if redirect_immediately
@controller.redirect_to url, status: :see_other
else
assign(:url, url)
end
CASino::LogoutListener.class_eval do
def user_logged_out(url, redirect_immediately = false)
if redirect_immediately
@controller.redirect_to url, status: :see_other
else
@controller.redirect_to login_path
end
@controller.cookies.delete :tgt
end
end
@fernandomantoan
fernandomantoan / gist:3751190
Created September 19, 2012 18:05
Resolving the LaTeX error "I can't find file `phvr8t'"
sudo apt-get install texlive-fonts-extra
@fernandomantoan
fernandomantoan / gist:2635189
Created May 8, 2012 13:49
Sublime configuration
{
"auto_complete": true,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_with_fields": false,
"auto_indent": true,
"auto_match_enabled": true,
"color_scheme": "Packages/Color Scheme - Default/Railscasts.tmTheme",
"detect_indentation": true,
"font_face": "Inconsolata",