This file contains hidden or 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
activesupport (3.0.3) lib/active_support/dependencies.rb:304:in `depend_on' | |
activesupport (3.0.3) lib/active_support/dependencies.rb:216:in `require_dependency' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:148:in `modules_for_helpers' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:144:in `map!' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers' | |
actionpack (3.0.3) lib/action_controller/metal/helpers.rb:101:in `modules_for_helpers' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:97:in `helper' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:161:in `default_helper_module!' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:24:in `inherited' | |
actionpack (3.0.3) lib/abstract_controller/helpers.rb:24:in `class_eval' |
This file contains hidden or 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
class << YAML | |
def load_erb(file) | |
load( | |
ERB.new( | |
IO.read(file) | |
).result | |
) | |
end | |
end |
This file contains hidden or 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
def get_flash | |
signed_message = request.cookies['_project_name_session'] | |
if signed_message.present? | |
secret = ProjectName::Application.config.secret_token | |
verifier = ActiveSupport::MessageVerifier.new(secret) | |
session = verifier.verify(signed_message) | |
@flash = session.delete('flash') |
This file contains hidden or 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
(function ($) { | |
$.fn.konami = function (callback, code) { | |
code = code || "38,38,40,40,37,39,37,39,66,65,13"; | |
return this.each(function () { | |
var kkeys = []; | |
$(this).keydown(function (e) { | |
kkeys.push(e.keyCode); | |
if (kkeys.toString().indexOf(code) >= 0) { | |
$(this).unbind('keydown', arguments.callee); | |
callback(e); |
This file contains hidden or 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
amplify.store.remove = function ( key ) { | |
var value = amplify.store( key ); | |
amplify.store( key, null ); | |
return value; | |
} |
This file contains hidden or 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
/* | |
* Copyright (c) 2011 Lyconic, LLC. | |
* | |
* 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 | |
* furnished to do so, subject to the following conditions: | |
* |
This file contains hidden or 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
(function () { | |
function extendEach () { | |
var args = Array.prototype.slice.call(arguments), | |
child = this; | |
_.each(args, function (proto) { | |
child = child.extend(proto); | |
}); |
This file contains hidden or 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
# By Henrik Nyh <http://henrik.nyh.se> 2008-01-30. | |
# Free to modify and redistribute with credit. | |
require "rubygems" | |
require "hpricot" | |
module TextHelper | |
# Like the Rails _truncate_ helper but doesn't break HTML tags or entities. | |
def truncate_html(text, max_length = 30, ellipsis = "...") |
This file contains hidden or 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
/** | |
* `window.location` is a BAD api. Doesn't have a prototype, 'too much recursion' error | |
* if you try to inspect the constructor. Monkey-patching causes random disappearances | |
* of the monkey-patched function in Chrome, cloning causes 'too much recursion' in FF. | |
* | |
* This is what I'm reduced to. ಠ_ಠ | |
**/ | |
(function () { | |
function Location () { |
This file contains hidden or 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
class ApplicationController < ActionController::Base | |
before_filter :require_authentication | |
private | |
def require_authentication | |
unless current_certificate.verify(public_key) | |
head :forbidden | |
end | |
end |