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
<?php | |
class CustomField extends AppModel { | |
var $name = 'CustomField'; | |
var $actsAs = array('Search.Searchable'); | |
public $filterArgs = array(); | |
} |
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
# encoding: utf-8 | |
require "selenium-webdriver" | |
require "net/http" | |
require 'pathname' | |
require 'json' | |
driver = Selenium::WebDriver.for :chrome, :switches => %w[--ignore-certificate-errors --disable-popup-blocking --disable-translate] | |
driver.navigate.to "http://localhost:3000/admin" | |
login_email = driver.find_element(:id, 'admin_email') |
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
# app/models/ability.rb | |
class Ability | |
def setup_author_permissions_with_myliufoto! | |
self.setup_author_permissions_without_myliufoto! | |
can :manage, [Album, Photo] | |
end | |
alias_method_chain :setup_author_permissions!, :myliufoto |
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
# config/application.rb | |
... | |
module Myliufoto | |
class Application < Rails::Application | |
def self.activate | |
if Rails.env.development? | |
load File.join(config.root, 'lib', 'locomotive', 'rails', 'render.rb') | |
else | |
require File.join(config.root, 'lib', 'locomotive', 'rails', 'render.rb') |
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
module Liquid::Tags | |
class PageBanners < ::Liquid::Tag | |
Syntax = /(#{::Liquid::Expression}+)\s+max\s+([0-9]+)/ | |
def initialize(tag_name, markup, tokens, context) | |
if markup =~ Syntax | |
@collection_name = $1 | |
@max_number = $2 |
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
<h2>{{ artist.name }}</h2> | |
<div>{{ artist.bio }}</div> | |
{% with_scope artist: artist._id %} | |
{% assign comments = contents.comments %} | |
{% if comments == empty %} |
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
require 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(/^#{Rails.root.to_s}/, '') | |
@engine_paths ||= Rails::Application.railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |path| | |
engine_file = File.join(path, relative_name) |
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
module MyApp | |
class IncViewsCounterFor < ::Liquid::Tag | |
Syntax = /(#{::Liquid::Expression}+)?/ | |
def initialize(tag_name, markup, tokens, context) | |
if markup =~ Syntax | |
@name = $1 | |
else | |
raise ::Liquid::SyntaxError.new("Syntax Error in 'inc_views_counter_for' - Valid syntax: inc_views_counter_for <content>") |
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
error adding brasil.gov.br/brasil.gov.br.crt | |
error adding cacert.org/cacert.org.crt | |
error adding debconf.org/ca.crt | |
error adding gouv.fr/cert_igca_dsa.crt | |
error adding gouv.fr/cert_igca_rsa.crt |
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
java -version | |
Error occurred during initialization of VM | |
Could not reserve enough space for object heap | |
Could not create the Java virtual machine. |
NewerOlder