Skip to content

Instantly share code, notes, and snippets.


Antonio Salazar Cardozo Shadowfiend

View GitHub Profile
View gist:107657
NoMethodError in 'UserSessionsController when showing session data as JSON should return the UserSession converted to JSON'
undefined method `params' for #<ActionController::TestRequest:0x3137dd0>
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/controller_adapters/abstract_adapter.rb:30:in `params'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:95:in `params_credentials'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:71:in `params_enabled?'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:65:in `persist_by_params'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `send'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call'
View gist:153673
@implementation MyClass : CPObject
- (CPNumber)reverse
return 5;
View gist:189337
if ([delegate respondsToSelector:@selector(view:didDoSomething:)])
[delegate view:self didDoSomething:param];
View gist:189344
- (void)setDelegate:(id)aDelegate
delegateProxy = [DelegateProxy proxyWithDelegate:aDelegate];
View gist:189355
* Fixes some issues where SuperTab has trouble editing labels that have
* been truncated.
* The original SuperTab uses the same textField used by regular tabs to
* _display_ the label to edit it, as well, simply setting it to an
* editable text field instead of merely a dynamic one. However, when
* the tab truncates the text of the field for width, and then is edited
* again, this means that the text in the editable field is truncated.
View gist:189339
[delegateProxy view:self didDoSomething:param];
View redirectFixer.scala
private object noCometResponseSent extends SessionVar[Boolean](false)
LiftRules.redirectAjaxOnSessionLoss = false
LiftRules.noCometSessionPage = "/home"
// Returns true if we should send an empty response for a comet request,
// false otherwise. This is used to ensure we don't send multiple
// window.location redirects in the event of a server restart in response
// to comet requests. Sending multiple ones can send Firefox into an
View Boot-additions.scala
// In cases where we have an AJAX request for IE with an uploaded file, we
// assume we served through an iframe (a fairly safe assumption) and serve
// up the response with a content type of text/plain so that IE does not
// attempt to save the file.
LiftRules.responseTransformers.append {
resp =>
(for (req <- S.request) yield {
resp match {
case InMemoryResponse(data, headers, cookies, code)
if ! req.uploadedFiles.isEmpty &&
View gist:719431
collection.find (error, cursor) ->
cursor.toArray (error, results) ->
# Do stuff with results.
Shadowfiend / gist:965176
Created May 10, 2011
ReloadOnSessionLoss.setup can be run in Boot.scala
View gist:965176
package bootstrap.liftweb {
import net.liftweb.common._
import net.liftweb.http._
import js._
import LiftRules._
import net.liftweb.util.Helpers._
* Provides automatic reloading of the client on session loss.