This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This module implements a comfortable HTTP client to Redmine to post a | |
# new issue using the HTTP interface exposed by the Hoptoad redmine plugin: | |
# http://github.com/vjt/redmine_hoptoad_server | |
# (C) 2010 Panmind - Released under the terms of the Ruby License | |
# | |
module PM | |
# Usage example: | |
# | |
# class UserFeedbacksController < ApplicationController | |
# include PM::RedmineNotifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Because obtrusive JavaScript is evil, and the Joe developer must not | |
# be able to introduce it with an "innocent" :method => :delete option | |
# passed to a link_to. | |
# (C) 2010 Panmind - Released in the Public Domain | |
# | |
helper = ActionView::Helpers::JavaScriptHelper | |
keep = %w(javascript_tag javascript_cdata_section escape_javascript) | |
keep.map!(&:to_sym) if RUBY_VERSION.to_f >= 1.9 | |
methods = helper.public_instance_methods - keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ActiveRecord extension adding a "query_for" instance method to write | |
# different queries on different backends and an "rs_to_ary" helper to | |
# bypass AR completely. The DBMS often does the job better than AR :-) | |
# (C) 2010 Panmind - Released under the terms of the Ruby License | |
# | |
module PM | |
module AgnosticSQLHelpers | |
# Initializes the helpers on ActiveRecord::Base. | |
# | |
def self.included(ar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple interface to access sphinx dynamic attribute updates feature | |
# from ActiveRecord instances. Spinned off from http://panmind.org/ | |
# (C) 2010 Panmind - Released under the terms of the Ruby license. | |
# | |
module PM | |
module ThinkingSphinxUpdates | |
def self.included(base) | |
base.extend ClassMethods | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### This gist is obsoleted by the full plugin release: | |
### http://github.com/Panmind/recaptcha - check it out :-) | |
require 'timeout' | |
require 'mocha' | |
module PM | |
module Recaptcha | |
PrivateKey = 'your private key' | |
PublicKey = 'your public key' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### This gist is obsoleted by the full plugin release: | |
### http://github.com/Panmind/zendesk - check it out :-) | |
module ApplicationHelper | |
include PM::Zendesk::Helpers | |
# .... more helpers .... | |
end |