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_once(PATH_tslib.'class.tslib_fe.php'); | |
require_once(PATH_t3lib.'class.t3lib_userauth.php' ); | |
require_once(PATH_tslib.'class.tslib_feuserauth.php'); | |
require_once(PATH_t3lib.'class.t3lib_cs.php'); | |
require_once(PATH_tslib.'class.tslib_content.php') ; | |
require_once(PATH_t3lib.'class.t3lib_tstemplate.php'); | |
require_once(PATH_t3lib.'class.t3lib_page.php'); | |
class tx_extname_eid extends tslib_pibase |
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 | |
namespace Foo\Bar\Controller; | |
class ModelController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { | |
/** | |
* New action. | |
* | |
* Displays form in its current step. | |
* | |
* @param \Foo\Bar\Domain\Model\Model $model |
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
# Aim: load all activities having the same customer. | |
# | |
# PublicActivity::Activity(id: integer, trackable_id: integer, trackable_type: string, ...) | |
# => belongs_to :trackable, polymorphic: true | |
# => trackable is either Project or Service | |
PublicActivity::Activity.joins(:trackable) | |
# ActiveRecord::EagerLoadPolymorphicError: Can not eagerly load the polymorphic association :trackable |
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
class CredentialsController < ApplicationController | |
before_filter :assign_encryption_key | |
before_filter :request_encryption_key, unless: "Credential.key_present?", except: [:set_encryption_key] | |
def new | |
@credential = Credential.new | |
end | |
def create |
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 MyGem | |
module MyClassExtension | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def does_something_to(modifiers = {}, *args) | |
cattr_accessor :my_gem_modifiers | |
self.my_gem_modifiers = modifiers | |
end | |
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
# in app/controllers/application_controller.rb | |
require 'thing/exceptions' | |
class ApplicationController < ActionController::Base | |
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
# app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
require 'myapp/exceptions' | |
include MyApp::Exceptions | |
end | |
# config/application.rb | |
module Myapp | |
class Application < Rails::Application | |
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
<header_images> | |
<TCEforms type="array"> | |
<config type="array"> | |
<type>group</type> | |
<internal_type>file</internal_type> | |
<allowed>gif,png,jpg,jpeg</allowed> | |
<max_size>1000</max_size> | |
<uploadfolder>uploads/media</uploadfolder> | |
<show_thumbs>5</show_thumbs> | |
<size>5</size> |
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
resources :recordings do | |
get '/:year/:month/:day', :on => :collection, :action => :index, :constraints => {:day => /\D{1,2}/, :month => /\D{1,2}/, :year => /\D{4}/} | |
end | |
<%= link_to 'previous day', recordings_path(:year => (@date-1.day).year, :month => (@date-1.day).month, :day => (@date-1.day).day) %> | |
# generates <a href="/recordings?year=yyy&month=mm&day=dd"> | |
# desired: <a href="/recordings/yyyy/mm/dd"></a> |
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
$(function() | |
{ | |
applyUiTo('body'); | |
$('a[data-modal=true]').on('click', function(event) | |
{ | |
$.get($(this).attr('href'), function(data) { | |
$(data).modal({ | |
// No problem here because I have a selector |
NewerOlder